< prev index next >

test/compiler/rtm/locking/TestRTMSpinLoopCount.java

Print this page

        

*** 27,36 **** --- 27,37 ---- * @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,77 **** 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 { 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]); --- 42,69 ---- import compiler.testlibrary.rtm.BusyLock; import compiler.testlibrary.rtm.CompilableTest; import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMTestBase; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; 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 { 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 }; 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,126 **** return lock.getTotalAborts(); } public static void main(String args[]) throws Throwable { ! new TestRTMSpinLoopCount().test(); } } --- 111,118 ---- return lock.getTotalAborts(); } public static void main(String args[]) throws Throwable { ! new TestRTMSpinLoopCount().runTestCases(); } }
< prev index next >