[lworld] RFR: 8376171: [lworld] Enable storing the hash code in the mark word of value objects [v3]

Stefan Karlsson stefank at openjdk.org
Tue Jan 27 14:03:34 UTC 2026


On Tue, 27 Jan 2026 13:53:12 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> src/hotspot/share/prims/jvm.cpp line 804:
>> 
>>> 802:     markWord old_mark, new_mark, test;
>>> 803:     do {
>>> 804:       old_mark = ho->mark_acquire();
>> 
>> Can this be just:
>> 
>> Suggestion:
>> 
>>       old_mark = ho->mark();
>> 
>> I don't see why this would require an "acquire".
>
> I took this from `ObjectSynchronizer::FastHashCode` but I can convert it back to `mark()` if you think it's not needed.

I "think" `ObjectSynchronizer::FastHashCode` needs it to "acquire" the monitor object in the else branch inside that function.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1954#discussion_r2732149450


More information about the valhalla-dev mailing list