[lworld] RFR: 8376171: [lworld] Enable storing the hash code in the mark word of value objects [v3]
Paul Hübner
phubner at openjdk.org
Tue Jan 27 10:32:26 UTC 2026
On Tue, 27 Jan 2026 10:15:30 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use CAS to set mark
>
> 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?
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1954#discussion_r2731322346
More information about the valhalla-dev
mailing list