[aarch64-port-dev ] RFR: JDK9: Fix biased locking

Edward Nevill edward.nevill at linaro.org
Mon May 19 15:23:08 UTC 2014


Hi,

The following patch fixes biased locking and re-enables it.

I have tested it with jtreg/hotspot, jtreg/langtools and SPECjvm2008.

This patch modifies shared code (it re-enables biased locking).

OK to push?
Ed.

--- CUT HERE ---
# HG changeset patch
# User Edward Nevill edward.nevill at linaro.org
# Date 1400512495 -3600
#      Mon May 19 16:14:55 2014 +0100
# Node ID ddbcca4965f29762ced6755229642c9f4694536e
# Parent  a1363bc1be1dbe8a3bbe72732c30a27487753ed6
Fix biased locking and re-enable

diff -r a1363bc1be1d -r ddbcca4965f2 src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
--- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Mon May 19 07:19:20 2014 -0400
+++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp	Mon May 19 16:14:55 2014 +0100
@@ -414,7 +414,7 @@
     Label here;
     load_prototype_header(tmp_reg, obj_reg);
     orr(tmp_reg, rthread, tmp_reg);
-    cmpxchgptr(tmp_reg, swap_reg, obj_reg, rscratch1, here, slow_case);
+    cmpxchgptr(swap_reg, tmp_reg, obj_reg, rscratch1, here, slow_case);
     // If the biasing toward our thread failed, then another thread
     // succeeded in biasing it toward itself and we need to revoke that
     // bias. The revocation will occur in the runtime in the slow case.
@@ -441,7 +441,7 @@
   {
     Label here, nope;
     load_prototype_header(tmp_reg, obj_reg);
-    cmpxchgptr(tmp_reg, swap_reg, obj_reg, rscratch1, here, &nope);
+    cmpxchgptr(swap_reg, tmp_reg, obj_reg, rscratch1, here, &nope);
     bind(here);
 
     // Fall through to the normal CAS-based lock, because no matter what
diff -r a1363bc1be1d -r ddbcca4965f2 src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Mon May 19 07:19:20 2014 -0400
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Mon May 19 16:14:55 2014 +0100
@@ -1818,7 +1818,7 @@
     __ ldr(obj_reg, Address(oop_handle_reg, 0));
 
     if (UseBiasedLocking) {
-      // __ biased_locking_enter(lock_reg, obj_reg, swap_reg, rscratch1, false, lock_done, &slow_path_lock);
+      __ biased_locking_enter(lock_reg, obj_reg, swap_reg, rscratch2, false, lock_done, &slow_path_lock);
     }
 
     // Load (object->mark() | 1) into swap_reg %r0
diff -r a1363bc1be1d -r ddbcca4965f2 src/share/vm/runtime/globals.hpp
--- a/src/share/vm/runtime/globals.hpp	Mon May 19 07:19:20 2014 -0400
+++ b/src/share/vm/runtime/globals.hpp	Mon May 19 16:14:55 2014 +0100
@@ -1257,7 +1257,7 @@
   product(bool, RestrictContended, true,                                    \
           "Restrict @Contended to trusted classes")                         \
                                                                             \
-  product(bool, UseBiasedLocking, false,                                    \
+  product(bool, UseBiasedLocking, true,                                     \
           "Enable biased locking in JVM")                                   \
                                                                             \
   product(intx, BiasedLockingStartupDelay, 4000,                            \
--- CUT HERE ---




More information about the aarch64-port-dev mailing list