RFR: 8256425: Obsolete Biased Locking in JDK 18 [v2]

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Fri Jun 18 15:04:28 UTC 2021


> 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

Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision:

 - remove test Test8062950.java + fix commments
 - fix comment in vm_version_ppc.cpp

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4522/files
  - new: https://git.openjdk.java.net/jdk/pull/4522/files/cba01d01..5f844d36

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4522&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4522&range=00-01

  Stats: 57 lines in 3 files changed: 6 ins; 48 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4522.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4522/head:pull/4522

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


More information about the hotspot-dev mailing list