< prev index next >
test/compiler/rtm/locking/TestRTMLockingThreshold.java
Print this page
*** 27,36 ****
--- 27,37 ----
* @summary Verify that RTMLockingThreshold affects rtm state transition
* ProfileRTM => UseRTM.
* @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,78 ****
import compiler.testlibrary.rtm.AbortProvoker;
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.internal.misc.Unsafe;
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 RTMLockingThreshold option actually affects how soon
* method will be deoptimized on low abort ratio.
*/
! public class TestRTMLockingThreshold extends CommandLineOptionTest {
! private TestRTMLockingThreshold() {
! super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
! }
/**
* We use non-zero abort threshold to avoid abort related to
* interrupts, VMM calls, etc. during first lock attempt.
*
*/
private static final int MIN_ABORT_THRESHOLD = 10;
- @Override
protected void runTestCases() throws Throwable {
verifyLockingThreshold(0, false);
verifyLockingThreshold(100, false);
verifyLockingThreshold(1000, false);
--- 42,71 ----
import compiler.testlibrary.rtm.AbortProvoker;
import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase;
import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.cli.CommandLineOptionTest;
import java.util.List;
/**
* Test verifies that RTMLockingThreshold option actually affects how soon
* method will be deoptimized on low abort ratio.
*/
! public class TestRTMLockingThreshold {
/**
* We use non-zero abort threshold to avoid abort related to
* interrupts, VMM calls, etc. during first lock attempt.
*
*/
private static final int MIN_ABORT_THRESHOLD = 10;
protected void runTestCases() throws Throwable {
verifyLockingThreshold(0, false);
verifyLockingThreshold(100, false);
verifyLockingThreshold(1000, false);
*** 181,188 ****
}
}
}
public static void main(String args[]) throws Throwable {
! new TestRTMLockingThreshold().test();
}
}
--- 174,181 ----
}
}
}
public static void main(String args[]) throws Throwable {
! new TestRTMLockingThreshold().runTestCases();
}
}
< prev index next >