< prev index next >

test/compiler/rtm/locking/TestUseRTMForStackLocks.java

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8031320
  28  * @summary Verify that rtm locking is used for stack locks.
  29  * @library /testlibrary /../../test/lib /compiler/testlibrary
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  * @build TestUseRTMForStackLocks
  33  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  34  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  35  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  36  *                   -XX:+WhiteBoxAPI TestUseRTMForStackLocks
  37  */
  38 
  39 import java.util.List;
  40 
  41 import com.oracle.java.testlibrary.*;
  42 import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
  43 import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
  44 import rtm.*;
  45 import rtm.predicate.SupportedCPU;
  46 import rtm.predicate.SupportedVM;
  47 
  48 /**
  49  * Test verifies that RTM-based lock elision could be used for stack locks
  50  * by calling compiled method that use RTM-based lock elision and using
  51  * stack lock.
  52  * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times,
  53  * so total locks count should be the same.
  54  * This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0
  55  * is used. For more information abort that issue see
  56  * {@link TestUseRTMAfterLockInflation}.
  57  */
  58 public class TestUseRTMForStackLocks extends CommandLineOptionTest {
  59     private static final boolean INFLATE_MONITOR = false;
  60 
  61     private TestUseRTMForStackLocks() {
  62         super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
  63     }




  21  * questions.
  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8031320
  28  * @summary Verify that rtm locking is used for stack locks.
  29  * @library /testlibrary /../../test/lib /compiler/testlibrary
  30  * @modules java.base/sun.misc
  31  *          java.management
  32  * @build TestUseRTMForStackLocks
  33  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  34  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  35  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  36  *                   -XX:+WhiteBoxAPI TestUseRTMForStackLocks
  37  */
  38 
  39 import java.util.List;
  40 
  41 import jdk.test.lib.*;
  42 import jdk.test.lib.cli.CommandLineOptionTest;
  43 import jdk.test.lib.cli.predicate.AndPredicate;
  44 import rtm.*;
  45 import rtm.predicate.SupportedCPU;
  46 import rtm.predicate.SupportedVM;
  47 
  48 /**
  49  * Test verifies that RTM-based lock elision could be used for stack locks
  50  * by calling compiled method that use RTM-based lock elision and using
  51  * stack lock.
  52  * Compiled method invoked {@code AbortProvoker.DEFAULT_ITERATIONS} times,
  53  * so total locks count should be the same.
  54  * This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0
  55  * is used. For more information abort that issue see
  56  * {@link TestUseRTMAfterLockInflation}.
  57  */
  58 public class TestUseRTMForStackLocks extends CommandLineOptionTest {
  59     private static final boolean INFLATE_MONITOR = false;
  60 
  61     private TestUseRTMForStackLocks() {
  62         super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
  63     }


< prev index next >