RFR: 8319799: Recursive lightweight locking: x86 implementation [v2]

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Nov 15 07:33:48 UTC 2023


On Mon, 13 Nov 2023 15:48:00 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> Axel Boldt-Christmas has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - Fix type
>>  - Move inflated check in fast_locked
>>  - Move top load
>
> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 974:
> 
>> 972:     jcc(Assembler::notZero, inflated);
>> 973: 
>> 974:     // Load top.
> 
> I have found it to be beneficial to move up the load of the top-offset to between the load/prefetch of the mark-word and the test for monitor. This way we do the test while the top-offset arrives and reduce the latency of the lock-stack-full-check.

Done.

> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 1072:
> 
>> 1070: 
>> 1071:     // Check if obj is top of lock-stack.
>> 1072:     movl(top, Address(thread, JavaThread::lock_stack_top_offset()));
> 
> Like above, moving the load of the top-offset up above ent mark-load should be harmless and potentially reduces the time that the following instructions have to wait for the top-offset to arrive.

Done.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16607#discussion_r1393763423
PR Review Comment: https://git.openjdk.org/jdk/pull/16607#discussion_r1393763501


More information about the hotspot-dev mailing list