diff test/compiler/whitebox/CompilerWhiteBoxTest.java @ 17869:5e6f84e7a942

8007270: Make IsMethodCompilable test work with tiered Summary: Only c2 compiles counts toward cutoff Reviewed-by: kvn, roland
author neliasso
date Tue, 28 Jan 2014 15:05:46 +0100
parents 4abb719c5620
children 52b4284cb496 c88a4554854c
line wrap: on
line diff
--- a/test/compiler/whitebox/CompilerWhiteBoxTest.java	Fri Apr 11 00:34:51 2014 +0400
+++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java	Tue Jan 28 15:05:46 2014 +0100
@@ -197,6 +197,29 @@
     }
 
     /**
+     * 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