diff src/cpu/x86/vm/macroAssembler_x86.cpp @ 17849:526acaf3626f

8038939: Some options related to RTM locking optimization works inconsistently Summary: Switch UseRTMXendForLockBusy flag ON by default and change code to retry RTM locking on lock busy condition by default. Reviewed-by: roland
author kvn
date Wed, 09 Apr 2014 11:18:02 -0700
parents 606acabe7b5c
children 400709e275c1
line wrap: on
line diff
--- a/src/cpu/x86/vm/macroAssembler_x86.cpp	Thu Apr 10 04:07:45 2014 -0700
+++ b/src/cpu/x86/vm/macroAssembler_x86.cpp	Wed Apr 09 11:18:02 2014 -0700
@@ -1488,11 +1488,10 @@
     movl(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort
     bind(L_rtm_retry);
   }
-  if (!UseRTMXendForLockBusy) {
-    movptr(tmpReg, Address(objReg, 0));
-    testptr(tmpReg, markOopDesc::monitor_value);  // inflated vs stack-locked|neutral|biased
-    jcc(Assembler::notZero, IsInflated);
-  }
+  movptr(tmpReg, Address(objReg, 0));
+  testptr(tmpReg, markOopDesc::monitor_value);  // inflated vs stack-locked|neutral|biased
+  jcc(Assembler::notZero, IsInflated);
+
   if (PrintPreciseRTMLockingStatistics || profile_rtm) {
     Label L_noincrement;
     if (RTMTotalCountIncrRate > 1) {
@@ -1512,10 +1511,7 @@
   Register abort_status_Reg = tmpReg; // status of abort is stored in RAX
   if (UseRTMXendForLockBusy) {
     xend();
-    movptr(tmpReg, Address(objReg, 0));
-    testptr(tmpReg, markOopDesc::monitor_value);  // inflated vs stack-locked|neutral|biased
-    jcc(Assembler::notZero, IsInflated);
-    movptr(abort_status_Reg, 0x1);                // Set the abort status to 1 (as xabort does)
+    movptr(abort_status_Reg, 0x2);   // Set the abort status to 2 (so we can retry)
     jmp(L_decrement_retry);
   }
   else {