mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-20 12:53:29 +00:00
8060454: [TESTBUG] Whitebox tests fail with -XX:CompileThreshold=100
Move the call to 'waitAndDeoptimize' from the warmup methods to the osr triggering methods to make sure that no non-osr compilation is in the queue after warmup. Reviewed-by: kvn
This commit is contained in:
parent
a87b3d13df
commit
415f2cd075
@ -530,7 +530,7 @@ enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
|
||||
* @param e Executable
|
||||
* @throws Exception
|
||||
*/
|
||||
private static void waitAndDeoptimize(Executable e) throws Exception {
|
||||
private static void waitAndDeoptimize(Executable e) {
|
||||
CompilerWhiteBoxTest.waitBackgroundCompilation(e);
|
||||
if (WhiteBox.getWhiteBox().isMethodQueuedForCompilation(e)) {
|
||||
throw new RuntimeException(e + " must not be in queue");
|
||||
@ -554,8 +554,6 @@ enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
|
||||
for (long i = 0; i < CompilerWhiteBoxTest.OSR_WARMUP; ++i) {
|
||||
result += (int)m.invoke(helper, 1);
|
||||
}
|
||||
// Deoptimize non-osr versions
|
||||
waitAndDeoptimize(m);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -573,8 +571,6 @@ enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
|
||||
for (long i = 0; i < CompilerWhiteBoxTest.OSR_WARMUP; ++i) {
|
||||
result += c.newInstance(null, 1).hashCode();
|
||||
}
|
||||
// Deoptimize non-osr versions
|
||||
waitAndDeoptimize(c);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -623,6 +619,11 @@ enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
|
||||
}
|
||||
|
||||
private static int osrStaticMethod(long limit) {
|
||||
if (limit != 1) {
|
||||
// Make sure there is no compiled version after warmup
|
||||
waitAndDeoptimize(OSR_STATIC);
|
||||
}
|
||||
// Trigger osr compilation
|
||||
int result = 0;
|
||||
for (long i = 0; i < limit; ++i) {
|
||||
result += staticMethod();
|
||||
@ -631,6 +632,11 @@ enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
|
||||
}
|
||||
|
||||
private int osrMethod(long limit) {
|
||||
if (limit != 1) {
|
||||
// Make sure there is no compiled version after warmup
|
||||
waitAndDeoptimize(OSR_METHOD);
|
||||
}
|
||||
// Trigger osr compilation
|
||||
int result = 0;
|
||||
for (long i = 0; i < limit; ++i) {
|
||||
result += method();
|
||||
@ -647,6 +653,11 @@ enum SimpleTestCase implements CompilerWhiteBoxTest.TestCase {
|
||||
|
||||
// for OSR constructor test case
|
||||
private Helper(Object o, long limit) {
|
||||
if (limit != 1) {
|
||||
// Make sure there is no compiled version after warmup
|
||||
waitAndDeoptimize(OSR_CONSTRUCTOR);
|
||||
}
|
||||
// Trigger osr compilation
|
||||
int result = 0;
|
||||
for (long i = 0; i < limit; ++i) {
|
||||
result += method();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user