[master] RFR: 8301562: [Lilliput] Runtime flag to enable Lilliput

Thomas Stuefe stuefe at openjdk.org
Fri Feb 24 18:53:33 UTC 2023


On Thu, 2 Feb 2023 13:04:27 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> This change introduces an experimental runtime flag -XX:[+/-]UseCompactObjectHeaders which can be used to disable Lilliput. The flag guards all the relevant places that directly affect the object layout and the accesses to Klass* etc. The change also restores the previous behaviour when -UseCompactObjectHeaders is selected.
> 
> Testing:
>  - [x] tier1 (x86_64, x86_32, aarch64) +UseCompactObjectHeaders
>  - [x] tier2 (x86_64, x86_32, aarch64) +UseCompactObjectHeaders
>  - [x] tier1 (x86_64, x86_32, aarch64) -UseCompactObjectHeaders
>  - [x] tier2 (x86_64, x86_32, aarch64) -UseCompactObjectHeaders

LogKlassAlignmentInBytes and everything depending on it will have to be switched to runtime-controlled variables. Nothing complex, just annoying. I'm on it.

Hi Roman,

Some fixes from my side, see branch https://github.com/tstuefe/lilliput/commits/fixes-to-usecompactobjectheader

Suggested changes:

1) https://github.com/tstuefe/lilliput/commit/38dcba1d06a56b01cf7c9a593656f1ae5109b9b0

this makes KlassAlignmentInBytes and friends runtime-controlled. This is really ugly, but the whole ccs- and compressed klass pointer encoding initialization deserves an overhaul, and this is the least intrusive fix possible.

2) https://github.com/tstuefe/lilliput/commit/ad929fafbb4f7c5785e5627b53f0de33dafd2501

Needed to fix a crash when compact headers are enabled.

3) https://github.com/tstuefe/lilliput/commit/e854428c077e596f81e1349107bc37c2b80c5237

Expands gtests to also test all permutations of CCS and CompactHeaders

4) https://github.com/tstuefe/lilliput/commit/4c01e6a017bda54e6cdee62ef8814756829fb489

Needed to move constraint check for CompressedClassPointerSize to after ergo

Cheers, thomas

Yeah, 32-bit is also broken. Sigh.

Okay, some more fixes:

https://github.com/tstuefe/lilliput/commit/b2f0364062e706303dc6ec8ee434700a51a99e30 : fix up aarch64 CCS allocation. 

I have planned to overhaul CCS initialization for a while, maybe its time. There are conceptional flaws, and it is really ugly too with all that aarch64-specific knowledge hardcoded into shared metaspace coding, and ppc64 piggybacking atop of that :-(

https://github.com/tstuefe/lilliput/commit/37d386aa1653040859442c0926753a78c17cdd84 : obvious fix for c1 on aarch64

https://github.com/tstuefe/lilliput/commit/dd5af41ce8845fc56f246321cdff55343671bcad : bunch of build fixes on 32-bit. This is another sore point, I really dislike all that 64-bit specific coding compiled into x86. It is this way in head too. I would love to see this fixed.

Remaining, as far as I see:

- `-XX:-UseCompressedClassPointers` crashes on aarch64 with `Internal Error (/shared/projects/openjdk/lilliput/source/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp:2570)`
- there are more fixes to be done for x86. `LIR_Assembler::emit_arraycopy` does not build.

P.s. I'm out of time now until next month (probably).

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

PR: https://git.openjdk.org/lilliput/pull/70


More information about the lilliput-dev mailing list