src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7017732_incremental Cdiff src/share/vm/classfile/classFileParser.cpp

src/share/vm/classfile/classFileParser.cpp

Print this page

        

*** 2711,2722 **** } return; } ! void ClassFileParser::java_lang_Class_fix_pre(objArrayHandle* methods_ptr, ! FieldAllocationCount *fac_ptr, TRAPS) { // Add fake fields for java.lang.Class instances // // This is not particularly nice. We should consider adding a // private transient object field at the Java level to // java.lang.Class. Alternatively we could add a subclass of --- 2711,2722 ---- } return; } ! void ClassFileParser::java_lang_Class_fix_pre(int* nonstatic_field_size, ! FieldAllocationCount *fac_ptr) { // Add fake fields for java.lang.Class instances // // This is not particularly nice. We should consider adding a // private transient object field at the Java level to // java.lang.Class. Alternatively we could add a subclass of
*** 2729,2743 **** // nonstatic oop fields were added at the Java level. The offsets // of these fake fields can't change between these two JDK // versions because when the offsets are computed at bootstrap // time we don't know yet which version of the JDK we're running in. ! // The values below are fake but will force two non-static oop fields and // a corresponding non-static oop map block to be allocated. const int extra = java_lang_Class::number_of_fake_oop_fields; fac_ptr->nonstatic_oop_count += extra; ! fac_ptr->nonstatic_word_count += java_lang_Class::hc_number_of_fake_int_fields; } void ClassFileParser::java_lang_Class_fix_post(int* next_nonstatic_oop_offset_ptr) { // Cause the extra fake fields in java.lang.Class to show up before --- 2729,2745 ---- // nonstatic oop fields were added at the Java level. The offsets // of these fake fields can't change between these two JDK // versions because when the offsets are computed at bootstrap // time we don't know yet which version of the JDK we're running in. ! // The values below are fake but will force three non-static oop fields and // a corresponding non-static oop map block to be allocated. const int extra = java_lang_Class::number_of_fake_oop_fields; fac_ptr->nonstatic_oop_count += extra; ! ! // Reserve some leading space for fake ints ! *nonstatic_field_size += align_size_up(java_lang_Class::hc_number_of_fake_int_fields * BytesPerInt, heapOopSize) / heapOopSize; } void ClassFileParser::java_lang_Class_fix_post(int* next_nonstatic_oop_offset_ptr) { // Cause the extra fake fields in java.lang.Class to show up before
*** 3165,3183 **** (fac.static_short_count * BytesPerShort); next_static_type_offset = align_size_up((next_static_byte_offset + fac.static_byte_count ), wordSize ); static_field_size = (next_static_type_offset - next_static_oop_offset) / wordSize; - first_nonstatic_field_offset = instanceOopDesc::base_offset_in_bytes() + - nonstatic_field_size * heapOopSize; - next_nonstatic_field_offset = first_nonstatic_field_offset; // Add fake fields for java.lang.Class instances (also see below) if (class_name == vmSymbols::java_lang_Class() && class_loader.is_null()) { ! java_lang_Class_fix_pre(&methods, &fac, CHECK_(nullHandle)); } // adjust the vmentry field declaration in java.dyn.MethodHandle if (EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) { java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); } --- 3167,3186 ---- (fac.static_short_count * BytesPerShort); next_static_type_offset = align_size_up((next_static_byte_offset + fac.static_byte_count ), wordSize ); static_field_size = (next_static_type_offset - next_static_oop_offset) / wordSize; // Add fake fields for java.lang.Class instances (also see below) if (class_name == vmSymbols::java_lang_Class() && class_loader.is_null()) { ! java_lang_Class_fix_pre(&nonstatic_field_size, &fac); } + first_nonstatic_field_offset = instanceOopDesc::base_offset_in_bytes() + + nonstatic_field_size * heapOopSize; + next_nonstatic_field_offset = first_nonstatic_field_offset; + // adjust the vmentry field declaration in java.dyn.MethodHandle if (EnableMethodHandles && class_name == vmSymbols::sun_dyn_MethodHandleImpl() && class_loader.is_null()) { java_dyn_MethodHandle_fix_pre(cp, fields, &fac, CHECK_(nullHandle)); }
*** 3482,3499 **** next_nonstatic_type_offset = align_size_up(notaligned_offset, wordSize ); instance_size = align_object_size(next_nonstatic_type_offset / wordSize); assert(instance_size == align_object_size(align_size_up((instanceOopDesc::base_offset_in_bytes() + nonstatic_field_size*heapOopSize), wordSize) / wordSize), "consistent layout helper value"); - if (class_name == vmSymbols::java_lang_Class() && class_loader.is_null()) { - // record location of extra ints - java_lang_Class::oop_size_offset = next_nonstatic_word_offset; - next_nonstatic_word_offset += BytesPerInt; - java_lang_Class::static_oop_field_size_offset = next_nonstatic_word_offset; - next_nonstatic_word_offset += BytesPerInt; - } - // Number of non-static oop map blocks allocated at end of klass. const unsigned int total_oop_map_count = compute_oop_map_count(super_klass, nonstatic_oop_map_count, first_nonstatic_oop_offset); --- 3485,3494 ----
src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File