--- a/test/jtreg-ext/requires/VMProps.java Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jtreg-ext/requires/VMProps.java Thu Jun 07 17:38:34 2018 -0700
@@ -36,6 +36,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import sun.hotspot.code.Compiler;
import sun.hotspot.cpuinfo.CPUInfo;
import sun.hotspot.gc.GC;
import sun.hotspot.WhiteBox;
@@ -344,33 +345,7 @@
* @return true if Graal is used as JIT compiler.
*/
protected String isGraalEnabled() {
- // Graal is enabled if following conditions are true:
- // - we are not in Interpreter mode
- // - UseJVMCICompiler flag is true
- // - jvmci.Compiler variable is equal to 'graal'
- // - TieredCompilation is not used or TieredStopAtLevel is greater than 3
-
- Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
- if (useCompiler == null || !useCompiler)
- return "false";
-
- Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler");
- if (useJvmciComp == null || !useJvmciComp)
- return "false";
-
- // This check might be redundant but let's keep it for now.
- String jvmciCompiler = System.getProperty("jvmci.Compiler");
- if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) {
- return "false";
- }
-
- Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
- Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
- // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
- if (tieredCompilation != null && tieredCompilation && compLevel != null && compLevel <= 3)
- return "false";
-
- return "true";
+ return Compiler.isGraalEnabled() ? "true" : "false";
}