< prev index next >

src/share/vm/classfile/classFileParser.cpp

Print this page

        

*** 3712,3722 **** int next_static_double_offset = next_static_oop_offset + ((fac->count[STATIC_OOP]) * heapOopSize); if ( fac->count[STATIC_DOUBLE] && (Universe::field_type_should_be_aligned(T_DOUBLE) || Universe::field_type_should_be_aligned(T_LONG)) ) { ! next_static_double_offset = align_size_up(next_static_double_offset, BytesPerLong); } int next_static_word_offset = next_static_double_offset + ((fac->count[STATIC_DOUBLE]) * BytesPerLong); int next_static_short_offset = next_static_word_offset + --- 3712,3722 ---- int next_static_double_offset = next_static_oop_offset + ((fac->count[STATIC_OOP]) * heapOopSize); if ( fac->count[STATIC_DOUBLE] && (Universe::field_type_should_be_aligned(T_DOUBLE) || Universe::field_type_should_be_aligned(T_LONG)) ) { ! next_static_double_offset = align_up(next_static_double_offset, BytesPerLong); } int next_static_word_offset = next_static_double_offset + ((fac->count[STATIC_DOUBLE]) * BytesPerLong); int next_static_short_offset = next_static_word_offset +
*** 3854,3864 **** // Try to squeeze some of the fields into the gaps due to // long/double alignment. if (nonstatic_double_count > 0) { int offset = next_nonstatic_double_offset; ! next_nonstatic_double_offset = align_size_up(offset, BytesPerLong); if (compact_fields && offset != next_nonstatic_double_offset) { // Allocate available fields into the gap before double field. int length = next_nonstatic_double_offset - offset; assert(length == BytesPerInt, ""); nonstatic_word_space_offset = offset; --- 3854,3864 ---- // Try to squeeze some of the fields into the gaps due to // long/double alignment. if (nonstatic_double_count > 0) { int offset = next_nonstatic_double_offset; ! next_nonstatic_double_offset = align_up(offset, BytesPerLong); if (compact_fields && offset != next_nonstatic_double_offset) { // Allocate available fields into the gap before double field. int length = next_nonstatic_double_offset - offset; assert(length == BytesPerInt, ""); nonstatic_word_space_offset = offset;
*** 3904,3914 **** // let oops jump before padding with this allocation style if( allocation_style == 1 ) { next_nonstatic_oop_offset = next_nonstatic_padded_offset; if( nonstatic_oop_count > 0 ) { ! next_nonstatic_oop_offset = align_size_up(next_nonstatic_oop_offset, heapOopSize); } next_nonstatic_padded_offset = next_nonstatic_oop_offset + (nonstatic_oop_count * heapOopSize); } // Iterate over fields again and compute correct offsets. --- 3904,3914 ---- // let oops jump before padding with this allocation style if( allocation_style == 1 ) { next_nonstatic_oop_offset = next_nonstatic_padded_offset; if( nonstatic_oop_count > 0 ) { ! next_nonstatic_oop_offset = align_up(next_nonstatic_oop_offset, heapOopSize); } next_nonstatic_padded_offset = next_nonstatic_oop_offset + (nonstatic_oop_count * heapOopSize); } // Iterate over fields again and compute correct offsets.
*** 4059,4093 **** int real_offset = 0; FieldAllocationType atype = (FieldAllocationType) fs.allocation_type(); switch (atype) { case NONSTATIC_BYTE: ! next_nonstatic_padded_offset = align_size_up(next_nonstatic_padded_offset, 1); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += 1; break; case NONSTATIC_SHORT: ! next_nonstatic_padded_offset = align_size_up(next_nonstatic_padded_offset, BytesPerShort); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += BytesPerShort; break; case NONSTATIC_WORD: ! next_nonstatic_padded_offset = align_size_up(next_nonstatic_padded_offset, BytesPerInt); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += BytesPerInt; break; case NONSTATIC_DOUBLE: ! next_nonstatic_padded_offset = align_size_up(next_nonstatic_padded_offset, BytesPerLong); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += BytesPerLong; break; case NONSTATIC_OOP: ! next_nonstatic_padded_offset = align_size_up(next_nonstatic_padded_offset, heapOopSize); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += heapOopSize; // Record this oop in the oop maps if( nonstatic_oop_map_count > 0 && --- 4059,4093 ---- int real_offset = 0; FieldAllocationType atype = (FieldAllocationType) fs.allocation_type(); switch (atype) { case NONSTATIC_BYTE: ! next_nonstatic_padded_offset = align_up(next_nonstatic_padded_offset, 1); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += 1; break; case NONSTATIC_SHORT: ! next_nonstatic_padded_offset = align_up(next_nonstatic_padded_offset, BytesPerShort); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += BytesPerShort; break; case NONSTATIC_WORD: ! next_nonstatic_padded_offset = align_up(next_nonstatic_padded_offset, BytesPerInt); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += BytesPerInt; break; case NONSTATIC_DOUBLE: ! next_nonstatic_padded_offset = align_up(next_nonstatic_padded_offset, BytesPerLong); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += BytesPerLong; break; case NONSTATIC_OOP: ! next_nonstatic_padded_offset = align_up(next_nonstatic_padded_offset, heapOopSize); real_offset = next_nonstatic_padded_offset; next_nonstatic_padded_offset += heapOopSize; // Record this oop in the oop maps if( nonstatic_oop_map_count > 0 &&
*** 4145,4166 **** next_nonstatic_padded_offset += ContendedPaddingWidth; } int notaligned_nonstatic_fields_end = next_nonstatic_padded_offset; ! int nonstatic_fields_end = align_size_up(notaligned_nonstatic_fields_end, heapOopSize); ! int instance_end = align_size_up(notaligned_nonstatic_fields_end, wordSize); ! int static_fields_end = align_size_up(next_static_byte_offset, wordSize); int static_field_size = (static_fields_end - InstanceMirrorKlass::offset_of_static_fields()) / wordSize; nonstatic_field_size = nonstatic_field_size + (nonstatic_fields_end - nonstatic_fields_start) / heapOopSize; int instance_size = align_object_size(instance_end / 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"); // Invariant: nonstatic_field end/start should only change if there are // nonstatic fields in the class, or if the class is contended. We compare --- 4145,4166 ---- next_nonstatic_padded_offset += ContendedPaddingWidth; } int notaligned_nonstatic_fields_end = next_nonstatic_padded_offset; ! int nonstatic_fields_end = align_up(notaligned_nonstatic_fields_end, heapOopSize); ! int instance_end = align_up(notaligned_nonstatic_fields_end, wordSize); ! int static_fields_end = align_up(next_static_byte_offset, wordSize); int static_field_size = (static_fields_end - InstanceMirrorKlass::offset_of_static_fields()) / wordSize; nonstatic_field_size = nonstatic_field_size + (nonstatic_fields_end - nonstatic_fields_start) / heapOopSize; int instance_size = align_object_size(instance_end / wordSize); ! assert(instance_size == align_object_size(align_up( (instanceOopDesc::base_offset_in_bytes() + nonstatic_field_size*heapOopSize), wordSize) / wordSize), "consistent layout helper value"); // Invariant: nonstatic_field end/start should only change if there are // nonstatic fields in the class, or if the class is contended. We compare
< prev index next >