< prev index next >
test/compiler/rtm/locking/TestRTMSpinLoopCount.java
Print this page
@@ -27,10 +27,11 @@
* @summary Verify that RTMSpinLoopCount affects time spent
* between locking attempts.
* @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
@@ -41,37 +42,28 @@
import compiler.testlibrary.rtm.BusyLock;
import compiler.testlibrary.rtm.CompilableTest;
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 RTMSpinLoopCount increase time spent between retries
* by comparing amount of retries done with different RTMSpinLoopCount's values.
*/
-public class TestRTMSpinLoopCount extends CommandLineOptionTest {
+public class TestRTMSpinLoopCount {
private static final int LOCKING_TIME = 1000;
private static final int RTM_RETRY_COUNT = 1000;
private static final boolean INFLATE_MONITOR = true;
private static final long MAX_ABORTS = RTM_RETRY_COUNT + 1L;
private static final int[] SPIN_LOOP_COUNTS
= new int[] { 0, 100, 1_000, 1_000_000, 10_000_000 };
- private TestRTMSpinLoopCount() {
- super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
- }
-
- @Override
protected void runTestCases() throws Throwable {
long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length];
for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) {
aborts[i] = getAbortsCountOnLockBusy(
TestRTMSpinLoopCount.SPIN_LOOP_COUNTS[i]);
@@ -119,8 +111,8 @@
return lock.getTotalAborts();
}
public static void main(String args[]) throws Throwable {
- new TestRTMSpinLoopCount().test();
+ new TestRTMSpinLoopCount().runTestCases();
}
}
< prev index next >