8066770: EnqueueMethodForCompilationTest.java fails to compile method

Make compiles blocking and always check queue

Reviewed-by: kvn
This commit is contained in:
Nils Eliasson 2016-03-09 21:20:43 +01:00
parent 9e21021abb
commit b01a1a42e3
5 changed files with 46 additions and 11 deletions

View file

@ -22,6 +22,7 @@
*/
import java.util.function.Function;
import compiler.whitebox.CompilerWhiteBoxTest;
/*
@ -32,14 +33,24 @@ import compiler.whitebox.CompilerWhiteBoxTest;
* @build ClearMethodStateTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,compiler.whitebox.SimpleTestCase$Helper::* ClearMethodStateTest
* @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ClearMethodStateTest
* @summary testing of WB::clearMethodState()
* @author igor.ignatyev@oracle.com
*/
public class ClearMethodStateTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception {
CompilerWhiteBoxTest.main(ClearMethodStateTest::new, args);
String directive =
"[{ match:\"*SimpleTestCase$Helper.*\", BackgroundCompilation: false }, " +
" { match:\"*.*\", inline:\"-*SimpleTestCase$Helper.*\"}]";
if (WHITE_BOX.addCompilerDirective(directive) != 2) {
throw new RuntimeException("Could not add directive");
}
try {
CompilerWhiteBoxTest.main(ClearMethodStateTest::new, args);
} finally {
WHITE_BOX.removeCompilerDirective(2);
}
}
private ClearMethodStateTest(TestCase testCase) {
@ -58,6 +69,7 @@ public class ClearMethodStateTest extends CompilerWhiteBoxTest {
*/
@Override
protected void test() throws Exception {
checkNotCompiled();
compile();
WHITE_BOX.clearMethodState(method);