Integrated: 7904124: JOL: Correct mark header size for Lilliput V2 in object internals
Oli Gillespie
ogillespie at openjdk.org
Tue Jan 20 11:03:33 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`.
This pull request has now been integrated.
Changeset: bd87bd73
Author: Oli Gillespie <ogillespie at openjdk.org>
Committer: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jol/commit/bd87bd7302f7156fee8664e2091fab9fabc0a00a
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
7904124: JOL: Correct mark header size for Lilliput V2 in object internals
Reviewed-by: shade
-------------
PR: https://git.openjdk.org/jol/pull/66
More information about the jol-dev
mailing list