< prev index next >
test/compiler/tiered/LevelTransitionTest.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
*** 21,53 ****
* questions.
*/
/**
* @test LevelTransitionTest
* @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc
* java.management
* @ignore 8067651
! * @build TransitionsTestExecutor LevelTransitionTest
! * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
! * -XX:+WhiteBoxAPI -XX:+TieredCompilation
* -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
! * -XX:CompileCommand=compileonly,ExtendedTestCase$CompileMethodHolder::*
! * TransitionsTestExecutor LevelTransitionTest
! * @summary Test the correctness of compilation level transitions for different methods
*/
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.concurrent.Callable;
- import compiler.whitebox.CompilerWhiteBoxTest;
- import compiler.whitebox.SimpleTestCase;
public class LevelTransitionTest extends TieredLevelsTest {
! /** Shows if method was profiled by being executed on levels 2 or 3 */
protected boolean isMethodProfiled;
private int transitionCount;
public static void main(String[] args) throws Throwable {
assert (!CompilerWhiteBoxTest.skipOnTieredCompilation(false));
--- 21,61 ----
* questions.
*/
/**
* @test LevelTransitionTest
+ * @summary Test the correctness of compilation level transitions for different methods
* @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc
* java.management
+ *
* @ignore 8067651
! * @build compiler.tiered.TransitionsTestExecutor compiler.tiered.LevelTransitionTest
! * @run driver ClassFileInstaller sun.hotspot.WhiteBox
! * sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
! * -XX:+WhiteBoxAPI -XX:+TieredCompilation -XX:-UseCounterDecay
* -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCaseHelper::*
! * -XX:CompileCommand=compileonly,compiler.tiered.LevelTransitionTest$ExtendedTestCase$CompileMethodHolder::*
! * compiler.tiered.TransitionsTestExecutor
! * compiler.tiered.LevelTransitionTest
*/
+ package compiler.tiered;
+
+ import compiler.whitebox.CompilerWhiteBoxTest;
+ import compiler.whitebox.SimpleTestCase;
+
import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.concurrent.Callable;
public class LevelTransitionTest extends TieredLevelsTest {
! /**
! * Shows if method was profiled by being executed on levels 2 or 3
! */
protected boolean isMethodProfiled;
private int transitionCount;
public static void main(String[] args) throws Throwable {
assert (!CompilerWhiteBoxTest.skipOnTieredCompilation(false));
*** 101,112 ****
finish = false;
}
System.out.printf("Method %s is compiled on level %d. Expected level is %d%n", method, newLevel, expected);
checkLevel(expected, newLevel);
printInfo();
- };
}
/**
* Gets next expected level for the test case on each transition.
*
* @param currentLevel a level the test case is compiled on
--- 109,121 ----
finish = false;
}
System.out.printf("Method %s is compiled on level %d. Expected level is %d%n", method, newLevel, expected);
checkLevel(expected, newLevel);
printInfo();
}
+ ;
+ }
/**
* Gets next expected level for the test case on each transition.
*
* @param currentLevel a level the test case is compiled on
*** 193,205 ****
throw new Error("TESTBUG: Invocation failure", e);
}
};
}
}
- }
! enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase {
ACCESSOR_TEST("accessor"),
NONTRIVIAL_METHOD_TEST("nonTrivialMethod"),
TRIVIAL_CODE_TEST("trivialCode");
private final Executable executable;
--- 202,213 ----
throw new Error("TESTBUG: Invocation failure", e);
}
};
}
}
! private static enum ExtendedTestCase implements CompilerWhiteBoxTest.TestCase {
ACCESSOR_TEST("accessor"),
NONTRIVIAL_METHOD_TEST("nonTrivialMethod"),
TRIVIAL_CODE_TEST("trivialCode");
private final Executable executable;
*** 227,253 ****
private static class CompileMethodHolder {
private final int iter = 10;
private int field = 42;
! /** Non-trivial method for threshold policy: contains loops */
public int nonTrivialMethod() {
int acc = 0;
for (int i = 0; i < iter; i++) {
acc += i;
}
return acc;
}
! /** Field accessor method */
public int accessor() {
return field;
}
! /** Method considered as trivial by amount of code */
public int trivialCode() {
int var = 0xBAAD_C0DE;
var *= field;
return var;
}
}
}
--- 235,269 ----
private static class CompileMethodHolder {
private final int iter = 10;
private int field = 42;
! /**
! * Non-trivial method for threshold policy: contains loops
! */
public int nonTrivialMethod() {
int acc = 0;
for (int i = 0; i < iter; i++) {
acc += i;
}
return acc;
}
! /**
! * Field accessor method
! */
public int accessor() {
return field;
}
! /**
! * Method considered as trivial by amount of code
! */
public int trivialCode() {
int var = 0xBAAD_C0DE;
var *= field;
return var;
}
}
+ }
+
}
< prev index next >