< prev index next >
test/compiler/rtm/locking/TestUseRTMForStackLocks.java
Print this page
@@ -26,10 +26,11 @@
* @bug 8031320
* @summary Verify that rtm locking is used for stack locks.
* @library /test/lib /
* @modules java.base/jdk.internal.misc
* java.management
+ * @requires vm.flavor == "server" & !vm.emulatedClient & vm.rtm.cpu & vm.rtm.os
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI
@@ -40,17 +41,12 @@
import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase;
-import compiler.testlibrary.rtm.predicate.SupportedCPU;
-import compiler.testlibrary.rtm.predicate.SupportedOS;
-import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer;
-import jdk.test.lib.cli.CommandLineOptionTest;
-import jdk.test.lib.cli.predicate.AndPredicate;
import java.util.List;
/**
* Test verifies that RTM-based lock elision could be used for stack locks
@@ -60,18 +56,13 @@
* so total locks count should be the same.
* This test could also be affected by retriable aborts, so -XX:RTMRetryCount=0
* is used. For more information abort that issue see
* {@link TestUseRTMAfterLockInflation}.
*/
-public class TestUseRTMForStackLocks extends CommandLineOptionTest {
+public class TestUseRTMForStackLocks {
private static final boolean INFLATE_MONITOR = false;
- private TestUseRTMForStackLocks() {
- super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
- }
-
- @Override
protected void runTestCases() throws Throwable {
AbortProvoker provoker = AbortType.XABORT.provoker();
RTMLockingStatistics lock;
OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
@@ -98,8 +89,8 @@
"Total locks count should be greater or equal to "
+ AbortProvoker.DEFAULT_ITERATIONS);
}
public static void main(String args[]) throws Throwable {
- new TestUseRTMForStackLocks().test();
+ new TestUseRTMForStackLocks().runTestCases();
}
}
< prev index next >