src/hotspot/share/classfile/classFileParser.cpp
changeset 49348 fde3feaaa4ed
parent 49340 4e82736053ae
child 49359 59f6547e151f
equal deleted inserted replaced
49347:edb65305d3ac 49348:fde3feaaa4ed
  4380       return;
  4380       return;
  4381   } else {
  4381   } else {
  4382     // add super class dependency
  4382     // add super class dependency
  4383     Klass* const super = defined_klass->super();
  4383     Klass* const super = defined_klass->super();
  4384     if (super != NULL) {
  4384     if (super != NULL) {
  4385       defining_loader_data->record_dependency(super, CHECK);
  4385       defining_loader_data->record_dependency(super);
  4386     }
  4386     }
  4387 
  4387 
  4388     // add super interface dependencies
  4388     // add super interface dependencies
  4389     const Array<Klass*>* const local_interfaces = defined_klass->local_interfaces();
  4389     const Array<Klass*>* const local_interfaces = defined_klass->local_interfaces();
  4390     if (local_interfaces != NULL) {
  4390     if (local_interfaces != NULL) {
  4391       const int length = local_interfaces->length();
  4391       const int length = local_interfaces->length();
  4392       for (int i = 0; i < length; i++) {
  4392       for (int i = 0; i < length; i++) {
  4393         defining_loader_data->record_dependency(local_interfaces->at(i), CHECK);
  4393         defining_loader_data->record_dependency(local_interfaces->at(i));
  4394       }
  4394       }
  4395     }
  4395     }
  4396   }
  4396   }
  4397 }
  4397 }
  4398 
  4398 
  5361 }
  5361 }
  5362 
  5362 
  5363 void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loadhook, TRAPS) {
  5363 void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loadhook, TRAPS) {
  5364   assert(ik != NULL, "invariant");
  5364   assert(ik != NULL, "invariant");
  5365 
  5365 
       
  5366   // Set name and CLD before adding to CLD
       
  5367   ik->set_class_loader_data(_loader_data);
       
  5368   ik->set_name(_class_name);
       
  5369 
       
  5370   // Add all classes to our internal class loader list here,
       
  5371   // including classes in the bootstrap (NULL) class loader.
       
  5372   const bool publicize = !is_internal();
       
  5373 
       
  5374   _loader_data->add_class(ik, publicize);
       
  5375 
  5366   set_klass_to_deallocate(ik);
  5376   set_klass_to_deallocate(ik);
  5367 
  5377 
  5368   assert(_field_info != NULL, "invariant");
  5378   assert(_field_info != NULL, "invariant");
  5369   assert(ik->static_field_size() == _field_info->static_field_size, "sanity");
  5379   assert(ik->static_field_size() == _field_info->static_field_size, "sanity");
  5370   assert(ik->nonstatic_oop_map_count() == _field_info->total_oop_map_count,
  5380   assert(ik->nonstatic_oop_map_count() == _field_info->total_oop_map_count,
  5375 
  5385 
  5376   // Fill in information already parsed
  5386   // Fill in information already parsed
  5377   ik->set_should_verify_class(_need_verify);
  5387   ik->set_should_verify_class(_need_verify);
  5378 
  5388 
  5379   // Not yet: supers are done below to support the new subtype-checking fields
  5389   // Not yet: supers are done below to support the new subtype-checking fields
  5380   ik->set_class_loader_data(_loader_data);
       
  5381   ik->set_nonstatic_field_size(_field_info->nonstatic_field_size);
  5390   ik->set_nonstatic_field_size(_field_info->nonstatic_field_size);
  5382   ik->set_has_nonstatic_fields(_field_info->has_nonstatic_fields);
  5391   ik->set_has_nonstatic_fields(_field_info->has_nonstatic_fields);
  5383   assert(_fac != NULL, "invariant");
  5392   assert(_fac != NULL, "invariant");
  5384   ik->set_static_oop_field_count(_fac->count[STATIC_OOP]);
  5393   ik->set_static_oop_field_count(_fac->count[STATIC_OOP]);
  5385 
  5394 
  5405   // is managed on the assumption that the initial cache
  5414   // is managed on the assumption that the initial cache
  5406   // size is equal to the number of methods in the class. If
  5415   // size is equal to the number of methods in the class. If
  5407   // that changes, then InstanceKlass::idnum_can_increment()
  5416   // that changes, then InstanceKlass::idnum_can_increment()
  5408   // has to be changed accordingly.
  5417   // has to be changed accordingly.
  5409   ik->set_initial_method_idnum(ik->methods()->length());
  5418   ik->set_initial_method_idnum(ik->methods()->length());
  5410 
       
  5411   ik->set_name(_class_name);
       
  5412 
  5419 
  5413   if (is_anonymous()) {
  5420   if (is_anonymous()) {
  5414     // _this_class_index is a CONSTANT_Class entry that refers to this
  5421     // _this_class_index is a CONSTANT_Class entry that refers to this
  5415     // anonymous class itself. If this class needs to refer to its own methods or
  5422     // anonymous class itself. If this class needs to refer to its own methods or
  5416     // fields, it would use a CONSTANT_MethodRef, etc, which would reference
  5423     // fields, it would use a CONSTANT_MethodRef, etc, which would reference