RFR: 8139457: Array bases are aligned at HeapWord granularity [v11]
Roman Kennke
rkennke at openjdk.org
Thu Jan 19 12:20:26 UTC 2023
On Thu, 19 Jan 2023 10:21:10 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/cpu/x86/macroAssembler_x86.cpp line 4136:
>
>> 4134: assert(is_aligned(offset_in_bytes, BytesPerInt), "offset must be a multiple of BytesPerInt");
>> 4135:
>> 4136: // note: for the remaining code to work, index must be a multiple of BytesPerInt
>
> Maybe move the comment to above the assert that checks the invariant described by the comment?
I think it is. The whole block below the comment is the runtime check for the described invariant. I re-worded it to be a bit clearer:
// For the remaining code to work, length must be a multiple of BytesPerInt.
// Check that here.
-------------
PR: https://git.openjdk.org/jdk/pull/11044
More information about the hotspot-dev
mailing list