RFR: 8139457: Array bases are aligned at HeapWord granularity [v55]

Stefan Karlsson stefank at openjdk.org
Wed Sep 13 13:02:05 UTC 2023


On Thu, 24 Aug 2023 11:56:15 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> See [JDK-8139457](https://bugs.openjdk.org/browse/JDK-8139457) for details.
>> 
>> Basically, when running with -XX:-UseCompressedClassPointers, arrays will have a gap between the length field and the first array element, because array elements will only start at word-aligned offsets. This is not necessary for smaller-than-word elements.
>> 
>> Also, while it is not very important now, it will become very important with Lilliput, which eliminates the Klass field and would always put the length field at offset 8, and leave a gap between offset 12 and 16.
>> 
>> Testing:
>>  - [x] runtime/FieldLayout/ArrayBaseOffsets.java (x86_64, x86_32, aarch64, arm, riscv, s390)
>>  - [x] bootcycle (x86_64, x86_32, aarch64, arm, riscv, s390)
>>  - [x] tier1 (x86_64, x86_32, aarch64, riscv)
>>  - [x] tier2 (x86_64, aarch64, riscv)
>>  - [x] tier3 (x86_64, riscv)
>
> Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 83 commits:
> 
>  - Merge remote-tracking branch 'upstream/master' into JDK-8139457
>  - Fix comments
>  - Fix inconsistencies in argument naming C1_MacroAssembler::allocate_array()
>  - Fix call to arrayOopDesc::header_size() in arm port
>  - Fix wrong alignment
>  - Move away arrayOopDesc::header_size()
>  - Move alignment-gap-clearing into allocate_array() (aarch64)
>  - Move header_size_in_bytes closer to length_offset_in_bytes
>  - RISCV fixes by @RealYFang
>  - Fix GetObjectSizeIntrinsicsTest.java to work correctly with +/-UseCCP
>  - ... and 73 more: https://git.openjdk.org/jdk/compare/97b94cb1...f48ad53b

There's gtest a failure in the GHA run:

 [ RUN      ] arrayOopDesc.double_vm
/home/runner/work/jdk/jdk/test/hotspot/gtest/oops/test_arrayOop.cpp:51: Failure
check_max_length_overflow(T_DOUBLE) evaluates to false, where
T_DOUBLE evaluates to 

[  FAILED  ] arrayOopDesc.double_vm (0 ms)
[ RUN      ] arrayOopDesc.byte_vm
[       OK ] arrayOopDesc.byte_vm (0 ms)
[ RUN      ] arrayOopDesc.short_vm
[       OK ] arrayOopDesc.short_vm (0 ms)
[ RUN      ] arrayOopDesc.int_vm
[       OK ] arrayOopDesc.int_vm (0 ms)
[ RUN      ] arrayOopDesc.long_vm
/home/runner/work/jdk/jdk/test/hotspot/gtest/oops/test_arrayOop.cpp:67: Failure
check_max_length_overflow(T_LONG) evaluates to false, where
T_LONG evaluates to 


[  FAILED  ] arrayOopDesc.long_vm (0 ms)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/11044#issuecomment-1717584433


More information about the hotspot-dev mailing list