[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 10:41:07 UTC 2026
On Tue, 27 Jan 2026 10:30:03 GMT, Paul Hübner <phubner at openjdk.org> wrote:
>> src/hotspot/share/prims/jvm.cpp line 809:
>>
>>> 807: } while (test != old_mark);
>>> 808:
>>> 809: return checked_cast<jint>(new_mark.hash());
>>
>> Can this be:
>> Suggestion:
>>
>> return checked_cast<jint>(hash);
>>
>> I want to make sure that I'm not missing some subtle detail here.
>
> Yes, that's a nice simplification. However that raises another question I have, how can we guarantee that between the CAS L806 and this cast L809 another thread hasn't updated the hash? Or do we not care if that's the case and up to the application to handle?
Good point!
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1954#discussion_r2731361617
More information about the valhalla-dev
mailing list