RFR: 8291555: Implement alternative fast-locking scheme [v29]

Vladimir Kozlov kvn at openjdk.org
Wed Mar 22 17:50:19 UTC 2023


On Wed, 22 Mar 2023 09:47:47 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 791:
>> 
>>> 789:       Compile::current()->output()->add_stub(stub);
>>> 790:       jcc(Assembler::notEqual, stub->entry());
>>> 791:       bind(stub->continuation());
>> 
>> Why use stub here and not inline the code? Because the branch mostly not taken?
>
> Yes, the branch is mostly not taken. If we inline the code, then we would have to take a forward branch on the very common path to skip over the (rare) part that handles ANON monitor owner. This would throw off static branch prediction and is discouraged by the Intel optimization guide.

okay

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

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


More information about the serviceability-dev mailing list