< prev index next >

src/hotspot/share/classfile/javaClasses.cpp

Print this page

        

*** 849,864 **** } else { k->set_java_mirror_handle(NULL); k->clear_has_raw_archived_mirror(); } } ! create_mirror(k, Handle(), Handle(), Handle(), CHECK); } void java_lang_Class::initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain, TRAPS) { // Allocate a simple java object for a lock. // This needs to be a java object because during class initialization // it can be held across a java call. typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK); --- 849,865 ---- } else { k->set_java_mirror_handle(NULL); k->clear_has_raw_archived_mirror(); } } ! create_mirror(k, Handle(), Handle(), Handle(), Handle(), CHECK); } void java_lang_Class::initialize_mirror_fields(Klass* k, Handle mirror, Handle protection_domain, + Handle classData, TRAPS) { // Allocate a simple java object for a lock. // This needs to be a java object because during class initialization // it can be held across a java call. typeArrayOop r = oopFactory::new_typeArray(T_INT, 0, CHECK);
*** 867,876 **** --- 868,880 ---- // Set protection domain also set_protection_domain(mirror(), protection_domain()); // Initialize static fields InstanceKlass::cast(k)->do_local_static_fields(&initialize_static_field, mirror, CHECK); + + // Set classData + set_class_data(mirror(), classData()); } // Set the java.lang.Module module field in the java_lang_Class mirror void java_lang_Class::set_mirror_module_field(Klass* k, Handle mirror, Handle module, TRAPS) { if (module.is_null()) {
*** 920,930 **** new (ResourceObj::C_HEAP, mtModule) GrowableArray<Klass*>(500, true); set_fixup_module_field_list(module_list); } void java_lang_Class::create_mirror(Klass* k, Handle class_loader, ! Handle module, Handle protection_domain, TRAPS) { assert(k != NULL, "Use create_basic_type_mirror for primitive types"); assert(k->java_mirror() == NULL, "should only assign mirror once"); // Use this moment of initialization to cache modifier_flags also, // to support Class.getModifiers(). Instance classes recalculate --- 924,935 ---- new (ResourceObj::C_HEAP, mtModule) GrowableArray<Klass*>(500, true); set_fixup_module_field_list(module_list); } void java_lang_Class::create_mirror(Klass* k, Handle class_loader, ! Handle module, Handle protection_domain, ! Handle classData, TRAPS) { assert(k != NULL, "Use create_basic_type_mirror for primitive types"); assert(k->java_mirror() == NULL, "should only assign mirror once"); // Use this moment of initialization to cache modifier_flags also, // to support Class.getModifiers(). Instance classes recalculate
*** 967,977 **** // See below for ordering dependencies between field array_klass in component mirror // and java_mirror in this klass. } else { assert(k->is_instance_klass(), "Must be"); ! initialize_mirror_fields(k, mirror, protection_domain, THREAD); if (HAS_PENDING_EXCEPTION) { // If any of the fields throws an exception like OOM remove the klass field // from the mirror so GC doesn't follow it after the klass has been deallocated. // This mirror looks like a primitive type, which logically it is because it // it represents no class. --- 972,982 ---- // See below for ordering dependencies between field array_klass in component mirror // and java_mirror in this klass. } else { assert(k->is_instance_klass(), "Must be"); ! initialize_mirror_fields(k, mirror, protection_domain, classData, THREAD); if (HAS_PENDING_EXCEPTION) { // If any of the fields throws an exception like OOM remove the klass field // from the mirror so GC doesn't follow it after the klass has been deallocated. // This mirror looks like a primitive type, which logically it is because it // it represents no class.
*** 1392,1401 **** --- 1397,1415 ---- void java_lang_Class::set_signers(oop java_class, objArrayOop signers) { assert(_signers_offset != 0, "must be set"); java_class->obj_field_put(_signers_offset, (oop)signers); } + oop java_lang_Class::class_data(oop java_class) { + assert(_classData_offset != 0, "must be set"); + return java_class->obj_field(_classData_offset); + } + void java_lang_Class::set_class_data(oop java_class, oop class_data) { + assert(_classData_offset != 0, "must be set"); + java_class->obj_field_put(_classData_offset, class_data); + } + void java_lang_Class::set_class_loader(oop java_class, oop loader) { // jdk7 runs Queens in bootstrapping and jdk8-9 has no coordinated pushes yet. if (_class_loader_offset != 0) { java_class->obj_field_put(_class_loader_offset, loader);
*** 4206,4215 **** --- 4220,4230 ---- int java_lang_Class::_component_mirror_offset; int java_lang_Class::_init_lock_offset; int java_lang_Class::_signers_offset; int java_lang_Class::_name_offset; int java_lang_Class::_source_file_offset; + int java_lang_Class::_classData_offset; GrowableArray<Klass*>* java_lang_Class::_fixup_mirror_list = NULL; GrowableArray<Klass*>* java_lang_Class::_fixup_module_field_list = NULL; int java_lang_Throwable::backtrace_offset; int java_lang_Throwable::detailMessage_offset; int java_lang_Throwable::stackTrace_offset;
< prev index next >