On Tue, 27 Jan 2026 10:15:30 GMT, Stefan Karlsson <[email protected]> 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

Reply via email to