src/share/vm/classfile/javaClasses.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/classfile/javaClasses.cpp	Fri Sep  5 16:06:23 2014
--- new/src/share/vm/classfile/javaClasses.cpp	Fri Sep  5 16:06:21 2014

*** 546,556 **** --- 546,556 ---- fs.set_offset(real_offset); } } } } ! create_mirror(k, Handle(NULL), CHECK); ! create_mirror(k, Handle(NULL), Handle(NULL), CHECK); } void java_lang_Class::initialize_mirror_fields(KlassHandle k, Handle mirror, Handle protection_domain,
*** 566,576 **** --- 566,577 ---- // Initialize static fields InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK); } ! void java_lang_Class::create_mirror(KlassHandle k, Handle protection_domain, TRAPS) { ! void java_lang_Class::create_mirror(KlassHandle k, Handle class_loader, + Handle protection_domain, TRAPS) { 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 // the cached flags after the class file is parsed, but before the // class is put into the system dictionary.
*** 621,630 **** --- 622,634 ---- java_lang_Class::set_klass(mirror(), NULL); return; } } + // set the classLoader field in the java_lang_Class instance + set_class_loader(mirror(), class_loader()); + // Setup indirection from klass->mirror last // after any exceptions can happen during allocations. if (!k.is_null()) { k->set_java_mirror(mirror()); }
*** 682,691 **** --- 686,707 ---- assert(_signers_offset != 0, "must be set"); java_class->obj_field_put(_signers_offset, (oop)signers); } + 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); + } + } + + oop java_lang_Class::class_loader(oop java_class) { + assert(_class_loader_offset != 0, "must be set"); + return java_class->obj_field(_class_loader_offset); + } + oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) { // This should be improved by adding a field at the Java level or by // introducing a new VM klass (see comment in ClassFileParser) oop java_class = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->allocate_instance(NULL, CHECK_0); if (type != T_VOID) {
*** 841,850 **** --- 857,872 ---- // The classRedefinedCount field is only present starting in 1.5, // so don't go fatal. compute_optional_offset(classRedefinedCount_offset, klass_oop, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature()); + // Needs to be optional because the old build runs Queens during bootstrapping + // and jdk8-9 doesn't have coordinated pushes yet. + compute_optional_offset(_class_loader_offset, + klass_oop, vmSymbols::classLoader_name(), + vmSymbols::classloader_signature()); + CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET); } int java_lang_Class::classRedefinedCount(oop the_class_mirror) { if (!JDK_Version::is_gte_jdk15x_version()
*** 3080,3089 **** --- 3102,3112 ---- int java_lang_Class::_klass_offset; int java_lang_Class::_array_klass_offset; int java_lang_Class::_oop_size_offset; int java_lang_Class::_static_oop_field_count_offset; + int java_lang_Class::_class_loader_offset; int java_lang_Class::_protection_domain_offset; int java_lang_Class::_init_lock_offset; int java_lang_Class::_signers_offset; GrowableArray<Klass*>* java_lang_Class::_fixup_mirror_list = NULL; int java_lang_Throwable::backtrace_offset;

src/share/vm/classfile/javaClasses.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File