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

Aleksey Shipilev shade at openjdk.org
Tue Jan 20 10:00:52 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`.

Yeah, this looks all right. 

There are might be other incompatibilities even with current mainline, but it is out of scope for this PR.

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

Marked as reviewed by shade (Committer).

PR Review: https://git.openjdk.org/jol/pull/66#pullrequestreview-3681336131


More information about the jol-dev mailing list