[master] RFR: Relax array elements alignment

Roman Kennke rkennke at openjdk.java.net
Mon Mar 7 18:34:00 UTC 2022


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.

GHA seems to see 3 new test failures (timeouts), but only on Windows(x64). I'm not quite sure how this is related, and probably needs some testing, once I get hold of a windows machine:

compiler/c2/irTests/TestAutoVectorization2DArray.java 
compiler/c2/irTests/TestIRAbs.java 
compiler/c2/irTests/TestStripMiningDropsSafepoint.java 

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)

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

Commit messages:
 - Revert unnecessary changes
 - Merge branch 'master' into relax-array-alignment2
 - Fix overflow
 - Attempt arm fix
 - Fix new test for 32bit
 - Add test to verify base offsets
 - Merge remote-tracking branch 'origin/relax-array-alignment2' into relax-array-alignment2
 - Aarch64 support
 - Build fix
 - Fix TestPLABPromotion
 - ... and 4 more: https://git.openjdk.java.net/lilliput/compare/9072ee12...1455f135

Changes: https://git.openjdk.java.net/lilliput/pull/41/files
 Webrev: https://webrevs.openjdk.java.net/?repo=lilliput&pr=41&range=00
  Stats: 214 lines in 21 files changed: 123 ins; 30 del; 61 mod
  Patch: https://git.openjdk.java.net/lilliput/pull/41.diff
  Fetch: git fetch https://git.openjdk.java.net/lilliput pull/41/head:pull/41

PR: https://git.openjdk.java.net/lilliput/pull/41


More information about the lilliput-dev mailing list