[master] Integrated: Relax array elements alignment
Roman Kennke
rkennke at openjdk.java.net
Fri Apr 29 10:26:48 UTC 2022
On Wed, 23 Feb 2022 13:03:03 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> PR #40 eliminated the Klass* word. A whole class of objects would not benefit from it, though: array elements are aligned at 8-byte-boundaries, even for element types where this is not necessary (byte, bool, char, short, int, float, compressed-objs). This means that array elements would still start at byte#16, after 8 bytes header and 4 bytes length and another 4 bytes unused gap.
>
> This change improves the array element alignment and relaxes it such that elements can align at 4-byte boundaries.
>
> Note about C2 changes: the code that extracts the state field (either byte, int or long array) assumed that all arrays would be equal, and asks for header size of T_INT. This would give wrong offset for T_LONG arrays.
>
> I'm adding a test that checks correct array elements base offsets.
>
> Testing:
> - [x] tier1 (x86_64)
> - [x] tier1 (x86_32)
> - [x] tier1 (aarch64)
> - [x] tier2 (x86_64)
> - [x] tier2 (x86_32)
> - [x] tier2 (aarch64)
> - [x] tier3 (x86_64)
> - [x] tier3 (x86_32)
> - [x] tier3 (aarch64)
This pull request has now been integrated.
Changeset: 0f6a4d29
Author: Roman Kennke <rkennke at openjdk.org>
URL: https://git.openjdk.java.net/lilliput/commit/0f6a4d2973611e61b3a78142ebb4103006893642
Stats: 212 lines in 21 files changed: 122 ins; 43 del; 47 mod
Relax array elements alignment
Reviewed-by: stuefe
-------------
PR: https://git.openjdk.java.net/lilliput/pull/41
More information about the lilliput-dev
mailing list