# HG changeset patch # User gromero # Date 1481810192 18000 # Node ID 3dccc891c216b61ebc48016f74cd0636876999e5 # Parent 543d79a36774b411794ba242db4581425d6e4a3b 8171266: PPC64: Add support to -XX:RTMSpinLoopCount=0 Reviewed-by: mdoerr, dholmes diff -r 543d79a36774 -r 3dccc891c216 hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp Thu Jan 05 09:25:36 2017 +0100 +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp Thu Dec 15 08:56:32 2016 -0500 @@ -2569,7 +2569,7 @@ } // 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 @@ -2577,15 +2577,22 @@ Label SpinLoop, doneRetry; addic_(retry_count_Reg, retry_count_Reg, -1); blt(CCR0, doneRetry); - li(R0, RTMSpinLoopCount); - mtctr(R0); + + if (RTMSpinLoopCount > 1) { + li(R0, RTMSpinLoopCount); + mtctr(R0); + } bind(SpinLoop); smt_yield(); // Can't use waitrsv(). No permission (SIGILL). - bdz(retryLabel); - ld(R0, 0, owner_addr_Reg); - cmpdi(CCR0, R0, 0); - bne(CCR0, SpinLoop); + + if (RTMSpinLoopCount > 1) { + bdz(retryLabel); + ld(R0, 0, owner_addr_Reg); + cmpdi(CCR0, R0, 0); + bne(CCR0, SpinLoop); + } + b(retryLabel); bind(doneRetry); diff -r 543d79a36774 -r 3dccc891c216 hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp Thu Jan 05 09:25:36 2017 +0100 +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp Thu Dec 15 08:56:32 2016 -0500 @@ -327,7 +327,10 @@ warning("RTMAbortRatio must be in the range 0 to 100, resetting it to 50"); FLAG_SET_DEFAULT(RTMAbortRatio, 50); } - guarantee(RTMSpinLoopCount > 0, "unsupported"); + if (RTMSpinLoopCount < 0) { + warning("RTMSpinLoopCount must not be a negative value, resetting it to 0"); + FLAG_SET_DEFAULT(RTMSpinLoopCount, 0); + } #else // Only C2 does RTM locking optimization. // Can't continue because UseRTMLocking affects UseBiasedLocking flag