--- old/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java 2015-12-21 12:20:12.871747513 -0800 +++ new/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java 2015-12-21 12:20:12.804747457 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,7 +90,7 @@ genericSignatureIndex = new CIntField(type.getCIntegerField("_generic_signature_index"), 0); majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0); minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0); - headerSize = Oop.alignObjectOffset(type.getSize()); + headerSize = type.getSize(); // read field offset constants ACCESS_FLAGS_OFFSET = db.lookupIntConstant("FieldInfo::access_flags_offset").intValue(); @@ -242,8 +242,8 @@ } public long getSize() { - return Oop.alignObjectSize(getHeaderSize() + Oop.alignObjectOffset(getVtableLen()) + - Oop.alignObjectOffset(getItableLen()) + Oop.alignObjectOffset(getNonstaticOopMapSize())); + return Oop.alignObjectSize(getHeaderSize() + getVtableLen() + + getItableLen() + getNonstaticOopMapSize()); } public static long getHeaderSize() { return headerSize; } --- old/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp 2015-12-21 12:20:13.127747729 -0800 +++ new/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp 2015-12-21 12:20:13.061747673 -0800 @@ -910,11 +910,6 @@ // lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base)); lea(scan_temp, Address(recv_klass, scan_temp, Address::lsl(3))); add(scan_temp, scan_temp, vtable_base); - if (HeapWordsPerLong > 1) { - // Round up to align_object_offset boundary - // see code for instanceKlass::start_of_itable! - round_to(scan_temp, BytesPerLong); - } // Adjust recv_klass by scaled itable_index, so we can free itable_index. assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); --- old/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2015-12-21 12:20:13.423747977 -0800 +++ new/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2015-12-21 12:20:13.355747920 -0800 @@ -2222,22 +2222,10 @@ // %%% We should store the aligned, prescaled offset in the klassoop. // Then the next several instructions would fold away. - int round_to_unit = ((HeapWordsPerLong > 1) ? BytesPerLong : 0); int itb_offset = vtable_base; - if (round_to_unit != 0) { - // hoist first instruction of round_to(scan_temp, BytesPerLong): - itb_offset += round_to_unit - wordSize; - } int itb_scale = exact_log2(vtableEntry::size() * wordSize); sll(scan_temp, itb_scale, scan_temp); add(scan_temp, itb_offset, scan_temp); - if (round_to_unit != 0) { - // Round up to align_object_offset boundary - // see code for InstanceKlass::start_of_itable! - // Was: round_to(scan_temp, BytesPerLong); - // Hoisted: add(scan_temp, BytesPerLong-1, scan_temp); - and3(scan_temp, -round_to_unit, scan_temp); - } add(recv_klass, scan_temp, scan_temp); // Adjust recv_klass by scaled itable_index, so we can free itable_index. --- old/src/cpu/sparc/vm/templateTable_sparc.cpp 2015-12-21 12:20:13.710748219 -0800 +++ new/src/cpu/sparc/vm/templateTable_sparc.cpp 2015-12-21 12:20:13.643748163 -0800 @@ -3159,9 +3159,6 @@ Register Rtemp = O1_flags; __ ld(O2_Klass, InstanceKlass::vtable_length_offset() * wordSize, Rtemp); - if (align_object_offset(1) > 1) { - __ round_to(Rtemp, align_object_offset(1)); - } __ sll(Rtemp, LogBytesPerWord, Rtemp); // Rscratch *= 4; if (Assembler::is_simm13(base)) { __ add(Rtemp, base, Rtemp); --- old/src/cpu/x86/vm/macroAssembler_x86.cpp 2015-12-21 12:20:13.987748453 -0800 +++ new/src/cpu/x86/vm/macroAssembler_x86.cpp 2015-12-21 12:20:13.918748394 -0800 @@ -6052,11 +6052,6 @@ // %%% Could store the aligned, prescaled offset in the klassoop. lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base)); - if (HeapWordsPerLong > 1) { - // Round up to align_object_offset boundary - // see code for InstanceKlass::start_of_itable! - round_to(scan_temp, BytesPerLong); - } // Adjust recv_klass by scaled itable_index, so we can free itable_index. assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); --- old/src/share/vm/oops/arrayKlass.cpp 2015-12-21 12:20:14.307748722 -0800 +++ new/src/share/vm/oops/arrayKlass.cpp 2015-12-21 12:20:14.239748664 -0800 @@ -42,11 +42,7 @@ // If this assert fails, see comments in base_create_array_klass. header_size = InstanceKlass::header_size(); int vtable_len = Universe::base_vtable_size(); -#ifdef _LP64 - int size = header_size + align_object_offset(vtable_len); -#else int size = header_size + vtable_len; -#endif return align_object_size(size); } --- old/src/share/vm/oops/instanceKlass.cpp 2015-12-21 12:20:14.557748932 -0800 +++ new/src/share/vm/oops/instanceKlass.cpp 2015-12-21 12:20:14.488748874 -0800 @@ -2910,12 +2910,9 @@ Klass::collect_statistics(sz); sz->_inst_size = HeapWordSize * size_helper(); - sz->_vtab_bytes = HeapWordSize * align_object_offset(vtable_length()); - sz->_itab_bytes = HeapWordSize * align_object_offset(itable_length()); - sz->_nonstatic_oopmap_bytes = HeapWordSize * - ((is_interface() || is_anonymous()) ? - align_object_offset(nonstatic_oop_map_size()) : - nonstatic_oop_map_size()); + sz->_vtab_bytes = HeapWordSize * vtable_length(); + sz->_itab_bytes = HeapWordSize * itable_length(); + sz->_nonstatic_oopmap_bytes = HeapWordSize * nonstatic_oop_map_size(); int n = 0; n += (sz->_methods_array_bytes = sz->count_array(methods())); --- old/src/share/vm/oops/instanceKlass.hpp 2015-12-21 12:20:14.825749158 -0800 +++ new/src/share/vm/oops/instanceKlass.hpp 2015-12-21 12:20:14.752749097 -0800 @@ -926,17 +926,15 @@ } // Sizing (in words) - static int header_size() { return align_object_offset(sizeof(InstanceKlass)/HeapWordSize); } + static int header_size() { return sizeof(InstanceKlass)/HeapWordSize; } static int size(int vtable_length, int itable_length, int nonstatic_oop_map_size, bool is_interface, bool is_anonymous) { return align_object_size(header_size() + - align_object_offset(vtable_length) + - align_object_offset(itable_length) + - ((is_interface || is_anonymous) ? - align_object_offset(nonstatic_oop_map_size) : - nonstatic_oop_map_size) + + vtable_length + + itable_length + + nonstatic_oop_map_size + (is_interface ? (int)sizeof(Klass*)/HeapWordSize : 0) + (is_anonymous ? (int)sizeof(Klass*)/HeapWordSize : 0)); } @@ -954,7 +952,7 @@ static int vtable_length_offset() { return offset_of(InstanceKlass, _vtable_len) / HeapWordSize; } intptr_t* start_of_vtable() const { return ((intptr_t*)this) + vtable_start_offset(); } - intptr_t* start_of_itable() const { return start_of_vtable() + align_object_offset(vtable_length()); } + intptr_t* start_of_itable() const { return start_of_vtable() + vtable_length(); } int itable_offset_in_words() const { return start_of_itable() - (intptr_t*)this; } intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); } @@ -962,7 +960,7 @@ address static_field_addr(int offset); OopMapBlock* start_of_nonstatic_oop_maps() const { - return (OopMapBlock*)(start_of_itable() + align_object_offset(itable_length())); + return (OopMapBlock*)(start_of_itable() + itable_length()); } Klass** end_of_nonstatic_oop_maps() const {