RFR: 8139457: Array bases are aligned at HeapWord granularity [v11]
Stefan Karlsson
stefank at openjdk.org
Thu Jan 19 13:36:35 UTC 2023
On Thu, 19 Jan 2023 11:05:33 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 25 commits:
>>
>> - Merge branch 'master' into JDK-8139457
>> - Fix gtest for correct base offsets in 32bit builds
>> - Fix cast warning
>> - Revert relaxation of array length
>> - Add guards to ArrayBaseOffsets test to allow running with -UseCompressedClassPointers
>> - Fix another cast warning
>> - Clean cast warning from size_t to int
>> - Clear leading 32bits in Z array allocator
>> - SA adjustments
>> - Test for 32bit build
>> - ... and 15 more: https://git.openjdk.org/jdk/compare/500b45e1...c278a53b
>
> src/hotspot/share/oops/arrayOop.hpp line 151:
>
>> 149: // overflowing an int when we add the header. See CRs 4718400 and 7110613.
>> 150: size_t header_size_words = heap_word_size(base_offset_in_bytes(type));
>> 151: return align_down(max_jint - static_cast<int>(header_size_words), MinObjAlignment);
>
> Can't immediately tell if this is correct, given that `heap_word_size` truncates the header. (Haven't checked yet if you have written unittests for this).
Strike this comment. heap_word_size doesn't truncate but instead align up.
-------------
PR: https://git.openjdk.org/jdk/pull/11044
More information about the hotspot-dev
mailing list