diff test/compiler/whitebox/CompilerWhiteBoxTest.java @ 14661:bbfe3ac1471d

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 f9a4b59ae350
children 2dfa56e10640
line wrap: on
line diff
--- a/test/compiler/whitebox/CompilerWhiteBoxTest.java	Mon Mar 03 08:04:14 2014 +0100
+++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java	Tue Jan 28 15:05:46 2014 +0100
@@ -196,6 +196,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