test/compiler/whitebox/CompilerWhiteBoxTest.java

Print this page
rev 5903 : 8007270: Make IsMethodCompilable test work with tiered
Summary: Only c2 compiles counts toward cutoff
Reviewed-by:

@@ -194,10 +194,33 @@
         System.out.println("at test's end:");
         printInfo();
     }
 
     /**
+     * Checks, that {@linkplain #method} is not compiled at the given compilation 
+     * level or above.
+     *
+     * @param compLevel         
+     *
+     * @throws RuntimeException if {@linkplain #method} is in compiler queue or
+     *                          is compiled, or if {@linkplain #method} has zero
+     *                          compilation level.
+     */
+     
+    protected final void checkNotCompiled(int compLevel) {
+        if (WHITE_BOX.isMethodQueuedForCompilation(method)) {
+            throw new RuntimeException(method + " must not be in queue");
+        }
+        if (WHITE_BOX.getMethodCompilationLevel(method, false) >= compLevel) {
+            throw new RuntimeException(method + " comp_level must be >= maxCompLevel");
+        }
+        if (WHITE_BOX.getMethodCompilationLevel(method, true) >= compLevel) {
+            throw new RuntimeException(method + " osr_comp_level must be >= maxCompLevel");
+        }
+    }
+    
+    /**
      * Checks, that {@linkplain #method} is not compiled.
      *
      * @throws RuntimeException if {@linkplain #method} is in compiler queue or
      *                          is compiled, or if {@linkplain #method} has zero
      *                          compilation level.