On Sat, 10 Apr 2021 15:38:11 GMT, Igor Ignatyev <[email protected]> wrote:
> should we remove `sun.hotspot.code.Compiler::isGraalEnabled` method and
> update a few of its users accordingly?
> what about `vm.graal.enabled` `@requires` property?
Thank you, @iignatev for looking on changes.
I forgot to mention that `Compiler::isGraalEnabled()` returns always false now.
Because 94 tests uses `@requires !vm.graal.enabled` I don't want to include
them in these changes which are already very big. I am not sure if I should
modify tests if GraalVM group wants to run all these tests.
Unfortunately changes in `Compiler.java` are listed the last on `Files changed`
tab and GitHub has trouble to load these big changes - it takes time to see
them. Here `Compiler.java` chnges for review:
diff --git a/test/lib/sun/hotspot/code/Compiler.java
b/test/lib/sun/hotspot/code/Compiler.java
index 99122bd93b8..71288ae4482 100644
--- a/test/lib/sun/hotspot/code/Compiler.java
+++ b/test/lib/sun/hotspot/code/Compiler.java
@@ -60,33 +60,10 @@ public class Compiler {
/**
* Check if Graal is used as JIT compiler.
*
- * 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
- * No need to check client mode because it set UseJVMCICompiler to false.
- *
- * @return true if Graal is used as JIT compiler.
+ * @return false because Graal is removed from JDK.
*/
public static boolean isGraalEnabled() {
- Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
- if (useCompiler == null || !useCompiler) {
- return false;
- }
- Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler");
- if (useJvmciComp == null || !useJvmciComp) {
- 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 false;
}
```
-------------
PR: https://git.openjdk.java.net/jdk/pull/3421