< prev index next >

src/cpu/ppc/vm/macroAssembler_ppc.cpp

Print this page
rev 12409 : 8171266: PPC64: Add support to -XX:RTMSpinLoopCount=0

@@ -2567,27 +2567,34 @@
   b(retryLabel);
   bind(doneRetry);
 }
 
 // Spin and retry if lock is busy.
-// inputs: box_Reg (monitor address)
+// inputs: owner_addr_Reg (monitor address)
 //       : retry_count_Reg
 // output: retry_count_Reg decremented by 1
 // CTR is killed
 void MacroAssembler::rtm_retry_lock_on_busy(Register retry_count_Reg, Register owner_addr_Reg, Label& retryLabel) {
   Label SpinLoop, doneRetry;
   addic_(retry_count_Reg, retry_count_Reg, -1);
   blt(CCR0, doneRetry);
+
+  if (RTMSpinLoopCount > 1) {
   li(R0, RTMSpinLoopCount);
   mtctr(R0);
+  }
 
   bind(SpinLoop);
   smt_yield(); // Can't use waitrsv(). No permission (SIGILL).
+
+  if (RTMSpinLoopCount > 1) {
   bdz(retryLabel);
   ld(R0, 0, owner_addr_Reg);
   cmpdi(CCR0, R0, 0);
   bne(CCR0, SpinLoop);
+  }
+
   b(retryLabel);
 
   bind(doneRetry);
 }
 
< prev index next >