[master] RFR: Fix arrays-equals intrinsic on AArch64 [v2]

Roman Kennke rkennke at openjdk.org
Thu Apr 25 08:31:39 UTC 2024


On Wed, 24 Apr 2024 16:06:05 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> The arrays-equals intrinsic on AArch64 assumes that array elements start at 8-byte-aligned boundary. There are several problems with that:
>> - I believe it may give wrong results when comparing some junk after the end of the array.
>> - We may crash when loading beyond the heap boundary.
>> 
>> The proposed fix is to start the comparison at the array-length field. When the array base is unaligned (that is really 4-byte-aligned), then the array-length is at 8-byte-aligned location. And since we want to compare the lengths anyway, we can just as well use word-sized loads to compare the length and first elements in a single step, and elide the separate cmp+branch for the length.
>
> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplify

Thanks! Let's refine and optimize the change in upstream.

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

PR Comment: https://git.openjdk.org/lilliput/pull/170#issuecomment-2076648040


More information about the lilliput-dev mailing list