Integrated: 8256425: Obsolete Biased Locking in JDK 18

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Thu Jun 24 18:58:39 UTC 2021


On Thu, 17 Jun 2021 15:37:40 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

> Hi all,
> 
> Please review the following patch which handles the removal of biased locking code. 
> 
> The third least significant bit of the markword is now always unused. I didn't try to give it back to the age field as it was prior to biased locking introduction since it will likely be taken away by other projects (probably Valhalla). 
> 
> Regarding c1 changes, the scratch register passed to LIRGenerator::monitor_enter() was only used by biased locking code except in ppc, so in all other platforms I removed the scratch parameter from C1_MacroAssembler::lock_object() (except in s390 where it wasn't defined already). 
> We could probably just always use R0 as a temp register in lock_object() for ppc, since we were already using it as temp in biased_locking_enter(), and remove the scratch parameter from there too. Then we could remove the scratch field from LIR_OpLock. I haven't done that in this patch though.
> 
> For c2, type.hpp defined XorXNode, StoreXConditionalNode, LoadXNode and StoreXNode as needed by UseOptoBiasInlining. I see that LoadXNode and StoreXNode are also used by shenandoahSupport so I kept those two defines. I removed only the biased locking comments from the storeIConditional/storeLConditional implementations in .ad files since I don't know if they might be needed.
> 
> There are some tests that were only meaningful when run with biased locking enabled so I removed them.
> 
> Tested in mach5 tiers 1-7. I tested it builds also on ppc, s390 and arm32 but can't run any tests on those platforms so it would be good if somebody can do some sanity check on those ones.
> 
> Thanks,
> Patricio

This pull request has now been integrated.

Changeset: 2fd7943e
Author:    Patricio Chilano Mateo <pchilanomate at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/2fd7943ec191559bfb2778305daf82bcc4422028
Stats:     5328 lines in 165 files changed: 66 ins; 5034 del; 228 mod

8256425: Obsolete Biased Locking in JDK 18

Reviewed-by: kvn, dholmes, dcubed, rrich

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

PR: https://git.openjdk.java.net/jdk/pull/4522


More information about the hotspot-runtime-dev mailing list