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

Aleksey Shipilev shade at openjdk.org
Wed Feb 15 13:41:59 UTC 2023


On Mon, 13 Feb 2023 17:55:06 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/FieldLayout/ArrayBaseOffsets.java line 110:
>> 
>>> 108:         Asserts.assertEquals(unsafe.arrayBaseOffset(float[].class),   intOffset,  "Misplaced float   array base");
>>> 109:         Asserts.assertEquals(unsafe.arrayBaseOffset(double[].class),  longOffset, "Misplaced double  array base");
>>> 110:         int expectedObjArrayOffset = (COOP || !Platform.is64bit()) ? intOffset : longOffset;
>> 
>> `|| !Platform.is64Bit()` looks redundant, since `COOP` is guaranteed to be false on 32-bit?
>
> No, because on 32 bit this expression becomes true, which is what we want - the small (int) offset for reference arrays.

Right, OK.

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

PR: https://git.openjdk.org/jdk/pull/11044


More information about the hotspot-dev mailing list