RFR: 8319799: Recursive lightweight locking: x86 implementation [v8]
Coleen Phillimore
coleenp at openjdk.org
Mon Jan 22 13:51:34 UTC 2024
On Fri, 19 Jan 2024 09:46:57 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:
>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 977:
>>
>>> 975: jcc(Assembler::notZero, inflated);
>>> 976:
>>> 977: // Check if lock-stack is full.
>>
>> Why doesn't this call MacroAssembler::lightweight_lock here?
>
> The main idea is to keep it separate, where the MacroAssembler caters to the interpreters needs.
>
> The biggest difference is that the interpreter has one less registers, so it does some more juggling.
> And on a fundamental level the interpreter must handles unstructured locking, while C2 does not. There is no practical difference to the lock/enter logic because of this difference, but there is for the unlock/exit logic.
>
> At some level the split should be that we have one implementation that handles the fixed amount of registers and unstructured locking scenario (interpreter). And one implementation which handles the case where we have a register allocator and and assumes structured locking (C1, C2). The native wrapper is somewhere in-between, is structured, but maybe has to use the first implementation due to register pressure.
Ok, that makes sense and a good idea for a future enhancement.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16607#discussion_r1459944578
More information about the hotspot-dev
mailing list