RFR: 8308469: [PPC64] Implement alternative fast-locking scheme [v2]

Roman Kennke rkennke at openjdk.org
Fri May 26 10:08:56 UTC 2023


On Fri, 26 May 2023 09:55:07 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

>> Thanks for your explanation!
>
>> The alternative here would be to detect this case and branch into the runtime to handle this, but handling it in compiled code is much more lightweight and not too difficult to do, nor does it add all that much to the code-size. Infact, this is very likely smaller because calling to the runtime needs a lot of scaffolding to push/pop all registers, etc.
> 
> But Roman of course the RT call wouldn't be part of the FastUnlock. Instead FastUnlock would return NE to indicate failure and then the slow path to the RT would be taken. So this is the smaller version.
> You'll have lots of uncontended unlocks with dead code. And you'll handle the anonymous case just once / inflation on the other hand.
> But everything's said now. I'm ok with it.

Ok, you are right! The anon case would just branch to the exit (zero flag would readily be un-set by the test, right?). The normal case would fall-through. This sounds like a useful simplification, and should not affect performance. I'll probably do that in x86_64 and aarch64, feel free to also simplify the PPC version.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14069#discussion_r1206534480


More information about the hotspot-dev mailing list