On Tue, 27 Jan 2026 10:30:03 GMT, Paul Hübner <[email protected]> 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

Reply via email to