40 public abstract class CompilerWhiteBoxTest { |
40 public abstract class CompilerWhiteBoxTest { |
41 /** {@code CompLevel::CompLevel_none} -- Interpreter */ |
41 /** {@code CompLevel::CompLevel_none} -- Interpreter */ |
42 protected static int COMP_LEVEL_NONE = 0; |
42 protected static int COMP_LEVEL_NONE = 0; |
43 /** {@code CompLevel::CompLevel_any}, {@code CompLevel::CompLevel_all} */ |
43 /** {@code CompLevel::CompLevel_any}, {@code CompLevel::CompLevel_all} */ |
44 protected static int COMP_LEVEL_ANY = -1; |
44 protected static int COMP_LEVEL_ANY = -1; |
|
45 /** {@code CompLevel::CompLevel_simple} -- C1 */ |
|
46 protected static int COMP_LEVEL_SIMPLE = 1; |
|
47 /** {@code CompLevel::CompLevel_full_optimization} -- C2 or Shark */ |
|
48 protected static int COMP_LEVEL_FULL_OPTIMIZATION = 4; |
|
49 |
45 /** Instance of WhiteBox */ |
50 /** Instance of WhiteBox */ |
46 protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
51 protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); |
47 /** Value of {@code -XX:CompileThreshold} */ |
52 /** Value of {@code -XX:CompileThreshold} */ |
48 protected static final int COMPILE_THRESHOLD |
53 protected static final int COMPILE_THRESHOLD |
49 = Integer.parseInt(getVMOption("CompileThreshold", "10000")); |
54 = Integer.parseInt(getVMOption("CompileThreshold", "10000")); |
89 protected static String getVMOption(String name, String defaultValue) { |
94 protected static String getVMOption(String name, String defaultValue) { |
90 String result = getVMOption(name); |
95 String result = getVMOption(name); |
91 return result == null ? defaultValue : result; |
96 return result == null ? defaultValue : result; |
92 } |
97 } |
93 |
98 |
|
99 /** copy of is_c1_compile(int) from utilities/globalDefinitions.hpp */ |
|
100 protected static boolean isC1Compile(int compLevel) { |
|
101 return (compLevel > COMP_LEVEL_NONE) |
|
102 && (compLevel < COMP_LEVEL_FULL_OPTIMIZATION); |
|
103 } |
|
104 |
|
105 /** copy of is_c2_compile(int) from utilities/globalDefinitions.hpp */ |
|
106 protected static boolean isC2Compile(int compLevel) { |
|
107 return compLevel == COMP_LEVEL_FULL_OPTIMIZATION; |
|
108 } |
|
109 |
94 /** tested method */ |
110 /** tested method */ |
95 protected final Executable method; |
111 protected final Executable method; |
96 private final Callable<Integer> callable; |
112 private final Callable<Integer> callable; |
97 |
113 |
98 /** |
114 /** |