RFR: 8139457: Array bases are aligned at HeapWord granularity [v38]
Aleksey Shipilev
shade at openjdk.org
Wed Jul 5 13:04:23 UTC 2023
On Tue, 4 Jul 2023 07:00:31 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Array.java line 68:
>>
>>> 66: return !VM.getVM().isCompressedOopsEnabled();
>>> 67: }
>>> 68: }
>>
>> I think `isCompressedOopsEnabled` already does the right thing, so:
>>
>> Suggestion:
>>
>> if (type == BasicType.T_OBJECT || type == BasicType.T_ARRAY) {
>> return !VM.getVM().isCompressedOopsEnabled();
>> }
>
> On 32-bit, isCompressedOopsEnabled() would be false, so the method returns true, which means we would 8-byte align reference array elements? That doesn't seem right.
Right, nevermind. I keep tripping over this. `isLP64` is actually symmetric to `#ifdef _LP64`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/11044#discussion_r1252979322
More information about the hotspot-dev
mailing list