RFR: 8319901: Recursive lightweight locking: ppc64le implementation

Martin Doerr mdoerr at openjdk.org
Tue Feb 20 18:19:18 UTC 2024


On Mon, 13 Nov 2023 13:49:30 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> Draft implementation of recursive lightweight JDK-8319796 for ppc64le.
>> 
>> Porters feel free to discard this and implement something from scratch, take this initial draft and run with it, or send patches to me and if you want me to drive the PR.
>> 
>> Some notes:
>> ppc64le deviates from the other ports, it shares it C2 locking code with the native call wrapper. This draft unifies the behavior across the ports by using the C1/interpreter locking for native call wrapper. If it is important to have a fast path for the inflated monitor case for native call wrapper, it could be done without having it share its implementation with C2. 
>> It would also be possible to change this behavior on all ports (share the C2 code), as I believe the C2 assumptions always hold for the native call wrapper, the monitor exit and monitor enter will be balanced and structured.
>
> src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp line 45:
> 
>> 43: void C2_MacroAssembler::fast_lock_lightweight(ConditionRegister flag, Register obj, Register box,
>> 44:                                               Register tmp1, Register tmp2, Register tmp3) {
>> 45:   // TODO: Current implementation does not use box, consider removing a TEMP and use box instead.
> 
> The `box` is only used by legacy locking for the displaced mark word. I think the related code can get cleaned up (including removal of the argument and the extra stack slot) when legacy locking gets removed.

The comment should get improved. It is currently not legal to kill `box` because the mach nodes don't use a KILL effect. This is currently wrong on aarch64, but correct on x86_64.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16611#discussion_r1495346019


More information about the hotspot-dev mailing list