RFR: 7904124: JOL: Correct mark header size for Lilliput V2 in object internals

duke duke at openjdk.org
Tue Jan 20 10:35:34 UTC 2026


On Mon, 22 Dec 2025 17:15:57 GMT, Oli Gillespie <ogillespie at openjdk.org> wrote:

> Before (mark header size is wrong, overlapping the first field):
> 
> java.lang.String object internals:
> OFF  SZ      TYPE DESCRIPTION               VALUE
>   0   8           (object header: mark)     0x0036449200bc8001 (Lilliput)
>   4   4       int String.hash               3556498
> 
> 
> After:
> 
> java.lang.String object internals:
> OFF  SZ      TYPE DESCRIPTION               VALUE
>   0   4           (object header: mark)     0x00bc8001 (Lilliput)
>   4   4       int String.hash               3556498
> 
> 
> ModelVM naively uses the address size as the mark header size, but that's not valid for Lilliput V2. Use object header size minus class header size instead (both of these are implemented for Lilliput V2). I'm not certain if this is correct in all scenarios.
> 
> **Testing**: spot-checked with Lilliput off, Lilliput V1 and Lilliput V2 for String and a few other classes. Ran `mvn clean verify`.

@olivergillespie 
Your change (at version bb7bb9bb4d89618799dc58e238629ecedac54048) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jol/pull/66#issuecomment-3772163656


More information about the jol-dev mailing list