< prev index next >

test/compiler/rtm/method_options/TestUseRTMLockElidingOption.java

Print this page




  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8031320
  28  * @summary Verify that UseRTMLockEliding option could be applied to
  29  *          specified method and that such method will not be deoptimized
  30  *          on high abort ratio.
  31  * @library /testlibrary /../../test/lib /compiler/testlibrary
  32  * @modules java.base/sun.misc
  33  *          java.management
  34  * @build TestUseRTMLockElidingOption
  35  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  36  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  37  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  38  *                   -XX:+WhiteBoxAPI TestUseRTMLockElidingOption
  39  */
  40 
  41 import java.util.List;
  42 import com.oracle.java.testlibrary.*;
  43 import com.oracle.java.testlibrary.cli.CommandLineOptionTest;
  44 import com.oracle.java.testlibrary.cli.predicate.AndPredicate;
  45 import rtm.*;
  46 import rtm.predicate.SupportedCPU;
  47 import rtm.predicate.SupportedVM;
  48 
  49 /**
  50  * Test verifies that method tagged with option <i>UseRTMLockElidingOption</i>
  51  * will use RTM-based lock elision, but will be never deoptimized with
  52  * <i>rtm_state_change reason</i>.
  53  * Test invokes compiled method and checks that no deoptimization with
  54  * <i>rtm_state_change</i> reason had happened and that that VM output
  55  * contains RTM locking statistics for compiled method and that total locks
  56  * count equals to method's invocations.
  57  * Since last assert is pretty strict, test uses -XX:RTMRetryCount=0 in order
  58  * to avoid issue with retriable aborts described in
  59  * {@link TestUseRTMAfterLockInflation}.
  60  */
  61 public class TestUseRTMLockElidingOption extends CommandLineOptionTest {
  62     private TestUseRTMLockElidingOption() {
  63         super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
  64     }




  22  *
  23  */
  24 
  25 /**
  26  * @test
  27  * @bug 8031320
  28  * @summary Verify that UseRTMLockEliding option could be applied to
  29  *          specified method and that such method will not be deoptimized
  30  *          on high abort ratio.
  31  * @library /testlibrary /../../test/lib /compiler/testlibrary
  32  * @modules java.base/sun.misc
  33  *          java.management
  34  * @build TestUseRTMLockElidingOption
  35  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  36  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  37  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
  38  *                   -XX:+WhiteBoxAPI TestUseRTMLockElidingOption
  39  */
  40 
  41 import java.util.List;
  42 import jdk.test.lib.*;
  43 import jdk.test.lib.cli.CommandLineOptionTest;
  44 import jdk.test.lib.cli.predicate.AndPredicate;
  45 import rtm.*;
  46 import rtm.predicate.SupportedCPU;
  47 import rtm.predicate.SupportedVM;
  48 
  49 /**
  50  * Test verifies that method tagged with option <i>UseRTMLockElidingOption</i>
  51  * will use RTM-based lock elision, but will be never deoptimized with
  52  * <i>rtm_state_change reason</i>.
  53  * Test invokes compiled method and checks that no deoptimization with
  54  * <i>rtm_state_change</i> reason had happened and that that VM output
  55  * contains RTM locking statistics for compiled method and that total locks
  56  * count equals to method's invocations.
  57  * Since last assert is pretty strict, test uses -XX:RTMRetryCount=0 in order
  58  * to avoid issue with retriable aborts described in
  59  * {@link TestUseRTMAfterLockInflation}.
  60  */
  61 public class TestUseRTMLockElidingOption extends CommandLineOptionTest {
  62     private TestUseRTMLockElidingOption() {
  63         super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
  64     }


< prev index next >