On Wed, 22 Mar 2023 09:46:04 GMT, Roman Kennke <rken...@openjdk.org> wrote:

>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 670:
>> 
>>> 668:   get_thread (scrReg);                    // beware: clobbers ICCs
>>> 669:   movptr(Address(boxReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), 
>>> scrReg);
>>> 670:   xorptr(boxReg, boxReg);                 // set icc.ZFlag = 1 to 
>>> indicate success
>> 
>> Should this be under `if (UseFastLocking)`?
>
> I don't think so, unless we also want to change all the stuff in x86_32.ad to 
> not fetch the thread before calling into fast_unlock(). However, I think it 
> is a nice and useful change. I could break it out of this PR and get it 
> reviewed separately, it is a side-effect of the new locking impl insofar as 
> we always require a thread register, and allocate&fetch it before going into 
> fast_lock().

I missed that it is under #ifndef LP64. Yes, it make since since you are now 
passing `thread` in register.
And why we need to `get_thread()` at line 708 if we already have it?

It is still hard to follow this 32-bit code. What each register is holding, 
what is value `3` and why we don't have checks similar to LP64 code after CAS?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/10907#discussion_r1145223128

Reply via email to