8023452: TestCase$Helper(java.lang.Object) must be osr_compiled
authoriignatyev
Sat, 28 Sep 2013 12:32:10 +0400
changeset 20294 af95d17f2e04
parent 20293 1dd93ae4304d
child 20295 a5dd1b071c32
8023452: TestCase$Helper(java.lang.Object) must be osr_compiled Reviewed-by: kvn
hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java
hotspot/test/compiler/whitebox/DeoptimizeAllTest.java
hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java
hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java
hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Sat Sep 28 12:32:09 2013 +0400
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java	Sat Sep 28 12:32:10 2013 +0400
@@ -74,6 +74,9 @@
     protected static final int THRESHOLD;
     /** count of invocation to triger OSR compilation */
     protected static final long BACKEDGE_THRESHOLD;
+    /** Value of {@code java.vm.info} (interpreted|mixed|comp mode) */
+    protected static final String MODE
+            = System.getProperty("java.vm.info");
 
     static {
         if (TIERED_COMPILATION) {
@@ -202,7 +205,7 @@
         if (WHITE_BOX.getMethodCompilationLevel(method, true) != 0) {
             throw new RuntimeException(method + " osr_comp_level must be == 0");
         }
-    }
+   }
 
     /**
      * Checks, that {@linkplain #method} is compiled.
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Sat Sep 28 12:32:09 2013 +0400
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java	Sat Sep 28 12:32:10 2013 +0400
@@ -53,6 +53,12 @@
      */
     @Override
     protected void test() throws Exception {
+        if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith(
+                "compiled ")) {
+          System.err.printf("Warning: %s is not applicable in %s%n",
+                testCase.name(), CompilerWhiteBoxTest.MODE);
+          return;
+        }
         compile();
         checkCompiled();
         WHITE_BOX.deoptimizeAll();
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Sat Sep 28 12:32:09 2013 +0400
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java	Sat Sep 28 12:32:10 2013 +0400
@@ -53,6 +53,12 @@
      */
     @Override
     protected void test() throws Exception {
+        if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith(
+                "compiled ")) {
+          System.err.printf("Warning: %s is not applicable in %s%n",
+                testCase.name(), CompilerWhiteBoxTest.MODE);
+          return;
+        }
         compile();
         checkCompiled();
         deoptimize();
--- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Sat Sep 28 12:32:09 2013 +0400
+++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java	Sat Sep 28 12:32:10 2013 +0400
@@ -70,12 +70,10 @@
 
         int compLevel = getCompLevel();
         int bci = WHITE_BOX.getMethodEntryBci(method);
-        System.out.println("bci = " + bci);
-        printInfo();
         deoptimize();
-        printInfo();
         checkNotCompiled();
-        printInfo();
+        WHITE_BOX.clearMethodState(method);
+
         WHITE_BOX.enqueueMethodForCompilation(method, compLevel, bci);
         checkCompiled();
         deoptimize();
--- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java	Sat Sep 28 12:32:09 2013 +0400
+++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java	Sat Sep 28 12:32:10 2013 +0400
@@ -68,6 +68,12 @@
      */
     @Override
     protected void test() throws Exception {
+        if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith(
+                "compiled ")) {
+          System.err.printf("Warning: %s is not applicable in %s%n",
+                testCase.name(), CompilerWhiteBoxTest.MODE);
+          return;
+        }
         if (!isCompilable()) {
             throw new RuntimeException(method + " must be compilable");
         }
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Sat Sep 28 12:32:09 2013 +0400
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java	Sat Sep 28 12:32:10 2013 +0400
@@ -62,6 +62,12 @@
      */
     @Override
     protected void test() throws Exception {
+        if (testCase.isOsr && CompilerWhiteBoxTest.MODE.startsWith(
+                "compiled ")) {
+          System.err.printf("Warning: %s is not applicable in %s%n",
+                testCase.name(), CompilerWhiteBoxTest.MODE);
+          return;
+        }
         checkNotCompiled();
         if (!isCompilable()) {
             throw new RuntimeException(method + " must be compilable");