diff test/compiler/whitebox/CompilerWhiteBoxTest.java @ 9080:b84fd7d73702

8007288: Additional WB API for compiler's testing Reviewed-by: kvn, vlivanov
author iignatyev
date Tue, 09 Apr 2013 09:54:17 -0700
parents 4efac99a998b
children 4b2eebe03f93
line wrap: on
line diff
--- a/test/compiler/whitebox/CompilerWhiteBoxTest.java	Mon Apr 08 07:40:08 2013 -0700
+++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java	Tue Apr 09 09:54:17 2013 -0700
@@ -37,6 +37,8 @@
             = Integer.parseInt(getVMOption("CompileThreshold", "10000"));
     protected static final boolean BACKGROUND_COMPILATION
             = Boolean.valueOf(getVMOption("BackgroundCompilation", "true"));
+    protected static final boolean TIERED_COMPILATION
+            = Boolean.valueOf(getVMOption("TieredCompilation", "false"));
 
     protected static Method getMethod(String name) {
         try {
@@ -81,6 +83,9 @@
     }
 
     protected static void checkNotCompiled(Method method) {
+        if (WHITE_BOX.isMethodQueuedForCompilation(method)) {
+            throw new RuntimeException(method + " must not be in queue");
+        }
         if (WHITE_BOX.isMethodCompiled(method)) {
             throw new RuntimeException(method + " must be not compiled");
         }
@@ -139,8 +144,11 @@
     protected abstract void test() throws Exception;
 
     protected final int compile() {
+        return compile(Math.max(COMPILE_THRESHOLD, 150000));
+    }
+
+    protected final int compile(int count) {
         int result = 0;
-        int count = Math.max(COMPILE_THRESHOLD, 150000);
         for (int i = 0; i < count; ++i) {
             result += method();
         }