src/share/vm/classfile/classFileParser.cpp

changeset 9858
b985cbb00e68
parent 9530
9fce84e6f51a
child 9859
7d05a422d710
equal deleted inserted replaced
9727:c7a3e57fdf4a 9858:b985cbb00e68
3882 } 3882 }
3883 verify_legal_class_modifiers(flags, CHECK_(nullHandle)); 3883 verify_legal_class_modifiers(flags, CHECK_(nullHandle));
3884 access_flags.set_flags(flags); 3884 access_flags.set_flags(flags);
3885 3885
3886 // This class and superclass 3886 // This class and superclass
3887 u2 this_class_index = cfs->get_u2_fast(); 3887 _this_class_index = cfs->get_u2_fast();
3888 check_property( 3888 check_property(
3889 valid_cp_range(this_class_index, cp_size) && 3889 valid_cp_range(_this_class_index, cp_size) &&
3890 cp->tag_at(this_class_index).is_unresolved_klass(), 3890 cp->tag_at(_this_class_index).is_unresolved_klass(),
3891 "Invalid this class index %u in constant pool in class file %s", 3891 "Invalid this class index %u in constant pool in class file %s",
3892 this_class_index, CHECK_(nullHandle)); 3892 _this_class_index, CHECK_(nullHandle));
3893 3893
3894 Symbol* class_name = cp->unresolved_klass_at(this_class_index); 3894 Symbol* class_name = cp->unresolved_klass_at(_this_class_index);
3895 assert(class_name != NULL, "class_name can't be null"); 3895 assert(class_name != NULL, "class_name can't be null");
3896 3896
3897 // It's important to set parsed_name *before* resolving the super class. 3897 // It's important to set parsed_name *before* resolving the super class.
3898 // (it's used for cleanup by the caller if parsing fails) 3898 // (it's used for cleanup by the caller if parsing fails)
3899 parsed_name = class_name; 3899 parsed_name = class_name;
4120 // is managed on the assumption that the initial cache 4120 // is managed on the assumption that the initial cache
4121 // size is equal to the number of methods in the class. If 4121 // size is equal to the number of methods in the class. If
4122 // that changes, then InstanceKlass::idnum_can_increment() 4122 // that changes, then InstanceKlass::idnum_can_increment()
4123 // has to be changed accordingly. 4123 // has to be changed accordingly.
4124 this_klass->set_initial_method_idnum(methods->length()); 4124 this_klass->set_initial_method_idnum(methods->length());
4125 this_klass->set_name(cp->klass_name_at(this_class_index)); 4125 this_klass->set_name(cp->klass_name_at(_this_class_index));
4126 if (is_anonymous()) // I am well known to myself 4126 if (is_anonymous()) // I am well known to myself
4127 cp->klass_at_put(this_class_index, this_klass()); // eagerly resolve 4127 cp->klass_at_put(_this_class_index, this_klass()); // eagerly resolve
4128 4128
4129 this_klass->set_minor_version(minor_version); 4129 this_klass->set_minor_version(minor_version);
4130 this_klass->set_major_version(major_version); 4130 this_klass->set_major_version(major_version);
4131 this_klass->set_has_default_methods(has_default_methods); 4131 this_klass->set_has_default_methods(has_default_methods);
4132 this_klass->set_declares_default_methods(declares_default_methods); 4132 this_klass->set_declares_default_methods(declares_default_methods);
5271 return NULL; 5271 return NULL;
5272 } 5272 }
5273 } 5273 }
5274 return NULL; 5274 return NULL;
5275 } 5275 }
5276
5277 #if INCLUDE_JFR
5278
5279 // Caller responsible for ResourceMark
5280 // clone stream with rewound position
5281 ClassFileStream* ClassFileParser::clone_stream() const {
5282 assert(_stream != NULL, "invariant");
5283
5284 return _stream->clone();
5285 }
5286
5287 void ClassFileParser::set_klass_to_deallocate(InstanceKlass* klass) {
5288 #ifdef ASSERT
5289 if (klass != NULL) {
5290 assert(NULL == _klass, "leaking?");
5291 }
5292 #endif
5293
5294 _klass = klass;
5295 }
5296
5297 #endif // INCLUDE_JFR

mercurial