[lilliput-jdk17u:lilliput] RFR: 8308011: [Lilliput/JDK17] Use narrow i-hash only when +UseCompactObjectHeaders

Roman Kennke rkennke at openjdk.org
Mon May 15 13:50:19 UTC 2023


On Mon, 15 May 2023 10:02:17 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Currently, we use a narrow 25bit identity-hash-code in Lilliput. That is even the case when running without compact object headers, even though we could just as well use the original 31bit identity hash-code then.
>> 
>> The fix is relatively simple. This is a backport of https://github.com/openjdk/lilliput/pull/93. Also, this brings the code in line with what we're currently proposing in upstream https://github.com/openjdk/jdk/pull/13844.
>> 
>> Testing:
>>  - [x] tier1 +UseCompactObjectHeaders
>>  - [ ] tier2 +UseCompactObjectHeaders
>>  - [x] tier1 -UseCompactObjectHeaders
>>  - [ ] tier2 -UseCompactObjectHeaders
>
> src/hotspot/share/oops/markWord.hpp line 155:
> 
>> 153:   static const int age_shift                      = self_forwarded_shift + self_forwarded_bits;
>> 154:   static const int unused_gap_shift               = age_shift + age_bits;
>> 155:   static const int hash_shift                     = unused_gap_shift + unused_gap_bits;
> 
> This moves `hash_shift` back to upstream state, right? Looks to me that way.

Yes, and the other constants, too. I'm adding *_constant variants of the relevant hash-related constants, and branch on UseCompactObjectHeaders in the relevant paths to get the legacy or new layout.

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

PR Review Comment: https://git.openjdk.org/lilliput-jdk17u/pull/16#discussion_r1193867917


More information about the lilliput-dev mailing list