< prev index next >
test/compiler/rtm/locking/TestUseRTMForInflatedLocks.java
Print this page
@@ -26,10 +26,11 @@
* @bug 8031320
* @summary Verify that rtm locking is used for inflated 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 compiler.rtm.locking.TestUseRTMForInflatedLocks
@@ -39,17 +40,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 inflated locks
@@ -59,16 +55,12 @@
* 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 TestUseRTMForInflatedLocks extends CommandLineOptionTest {
- private TestUseRTMForInflatedLocks() {
- super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
- }
+public class TestUseRTMForInflatedLocks {
- @Override
protected void runTestCases() throws Throwable {
AbortProvoker provoker = AbortType.XABORT.provoker();
RTMLockingStatistics lock;
OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest(
@@ -94,8 +86,8 @@
"Total lock count should be greater or equal to "
+ AbortProvoker.DEFAULT_ITERATIONS);
}
public static void main(String args[]) throws Throwable {
- new TestUseRTMForInflatedLocks().test();
+ new TestUseRTMForInflatedLocks().runTestCases();
}
}
< prev index next >