RFR: 8305895: Implement JEP 450: Compact Object Headers (Experimental) [v19]

Emanuel Peter epeter at openjdk.org
Mon Nov 18 14:44:19 UTC 2024


On Mon, 18 Nov 2024 14:38:20 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> @merykitty the object base is always at least `8-byte` aligned, see `ObjectAlignmentInBytes` - this also holds for all arrays. But the issue is the offset from the object base to the array payload.
>> 
>> @rkennke yes, working on fixing the tests :)
>
> @eme64 Please correct me if I'm wrong but the issue is you need the base to be aligned at 32 bytes on AVX2 machines for any alignment for vector instruction to be meaningful, so I don't see the value of vector alignment at all.

@merykitty 
> Please correct me if I'm wrong but the issue is you need the base to be aligned at 32 bytes on AVX2 machines for any alignment for vector instruction to be meaningful, so I don't see the value of vector alignment at all.

First: without `AlignVector`, the vector instructions can have completely free alignment. On x64 and aarch64 generally I think most machines do not need alignment at all. And as far as I know there is also no performance penalty on modern CPUs for misalignment. I could be wrong here. On older CPUs alignment was important for performance though.

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

PR Comment: https://git.openjdk.org/jdk/pull/20677#issuecomment-2483249163


More information about the serviceability-dev mailing list