diff test/compiler/whitebox/CompilerWhiteBoxTest.java @ 10200:d1c9384eecb4

8012322: Tiered: CompilationPolicy::can_be_compiled(CompLevel_all) mistakenly return false Reviewed-by: kvn, vlivanov
author iignatyev
date Fri, 26 Apr 2013 07:21:41 -0700
parents 4b2eebe03f93
children 11237ee74aae
line wrap: on
line diff
--- a/test/compiler/whitebox/CompilerWhiteBoxTest.java	Thu Apr 25 11:09:24 2013 -0700
+++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java	Fri Apr 26 07:21:41 2013 -0700
@@ -42,6 +42,11 @@
     protected static int COMP_LEVEL_NONE = 0;
     /** {@code CompLevel::CompLevel_any}, {@code CompLevel::CompLevel_all} */
     protected static int COMP_LEVEL_ANY = -1;
+    /** {@code CompLevel::CompLevel_simple} -- C1 */
+    protected static int COMP_LEVEL_SIMPLE = 1;
+    /** {@code CompLevel::CompLevel_full_optimization} -- C2 or Shark */
+    protected static int COMP_LEVEL_FULL_OPTIMIZATION = 4;
+
     /** Instance of WhiteBox */
     protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
     /** Value of {@code -XX:CompileThreshold} */
@@ -91,6 +96,17 @@
         return result == null ? defaultValue : result;
     }
 
+    /** copy of is_c1_compile(int) from utilities/globalDefinitions.hpp */
+    protected static boolean isC1Compile(int compLevel) {
+        return (compLevel > COMP_LEVEL_NONE)
+                && (compLevel < COMP_LEVEL_FULL_OPTIMIZATION);
+    }
+
+    /** copy of is_c2_compile(int) from utilities/globalDefinitions.hpp */
+    protected static boolean isC2Compile(int compLevel) {
+        return compLevel == COMP_LEVEL_FULL_OPTIMIZATION;
+    }
+
     /** tested method */
     protected final Executable method;
     private final Callable<Integer> callable;