This commit is contained in:
Igor Ignatyev 2017-10-03 06:48:40 +02:00
commit 5b3ed372a9
10 changed files with 49 additions and 6 deletions

View File

@ -52,7 +52,8 @@ requires.properties= \
vm.rtm.cpu \
vm.rtm.os \
vm.aot \
vm.cds
vm.cds \
vm.graal.enabled
# Minimum jtreg version
requiredVersion=4.2 b08

View File

@ -25,7 +25,7 @@
* @test
* @bug 8072016
* @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation
* @requires vm.flavor == "server" & !vm.emulatedClient
* @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
* @library /test/lib /
* @modules java.base/jdk.internal.misc
* java.management

View File

@ -26,6 +26,7 @@
* @bug 8004741
* @summary Missing compiled exception handle table entry for multidimensional array allocation
*
* @requires !vm.graal.enabled
* @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers
* -XX:+SafepointALot -XX:GuaranteedSafepointInterval=100

View File

@ -27,7 +27,7 @@
* @summary Tests jcmd to be able to add a directive to compile only specified methods
* @modules java.base/jdk.internal.misc
* @library /test/lib /
* @requires vm.flavor != "minimal"
* @requires vm.flavor != "minimal" & !vm.graal.enabled
*
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox

View File

@ -25,6 +25,8 @@
* @test
* @bug 8137167
* @summary Tests LogCompilation executed standalone without log commands or directives
*
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* @library /test/lib /
*

View File

@ -26,7 +26,7 @@
* @library /test/lib /
* @modules java.base/jdk.internal.misc
* java.management
* @requires vm.cpu.features ~= ".*aes.*"
* @requires vm.cpu.features ~= ".*aes.*" & !vm.graal.enabled
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission

View File

@ -24,6 +24,8 @@
/*
* @test
* @bug 8138651
*
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* @library /test/lib /
*

View File

@ -25,7 +25,7 @@
* @test NullCheckDroppingsTest
* @bug 8054492
* @summary Casting can result in redundant null checks in generated code
* @requires vm.flavor == "server" & !vm.emulatedClient
* @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management

View File

@ -28,7 +28,7 @@
* @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop
* @library /test/lib /
* @requires vm.compMode != "Xint" & vm.flavor == "server" & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4) & vm.debug == true
* @requires !vm.emulatedClient
* @requires !vm.emulatedClient & !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox

View File

@ -73,6 +73,8 @@ public class VMProps implements Callable<Map<String, String>> {
map.put("vm.aot", vmAOT());
// vm.cds is true if the VM is compiled with cds support.
map.put("vm.cds", vmCDS());
// vm.graal.enabled is true if Graal is used as JIT
map.put("vm.graal.enabled", isGraalEnabled());
vmGC(map); // vm.gc.X = true/false
VMProps.dump(map);
@ -292,6 +294,41 @@ public class VMProps implements Callable<Map<String, String>> {
}
}
/**
* Check if Graal is used as JIT compiler.
*
* @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";
}
/**
* Dumps the map to the file if the file name is given as the property.
* This functionality could be helpful to know context in the real