From b75504633bc0f4fcecc1c08552e556b26d9ffbb9 Mon Sep 17 00:00:00 2001 From: Tomas Zezula Date: Mon, 23 Sep 2024 09:27:30 +0200 Subject: [PATCH] JDK-8340398: Fixed EnableJVMCI handling. --- src/hotspot/share/jvmci/jvmci_globals.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hotspot/share/jvmci/jvmci_globals.cpp b/src/hotspot/share/jvmci/jvmci_globals.cpp index 543166ecf9d36..36740560dd23f 100644 --- a/src/hotspot/share/jvmci/jvmci_globals.cpp +++ b/src/hotspot/share/jvmci/jvmci_globals.cpp @@ -79,6 +79,15 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler) CHECK_NOT_SET(LibJVMCICompilerThreadHidden, UseJVMCICompiler) + if (UseJVMCICompiler) { + if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) { + jio_fprintf(defaultStream::error_stream(), + "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n"); + return false; + } + FLAG_SET_DEFAULT(EnableJVMCI, true); + } + if (EnableJVMCI) { if (FLAG_IS_DEFAULT(UseJVMCINativeLibrary) && !UseJVMCINativeLibrary) { char path[JVM_MAXPATHLEN]; @@ -91,12 +100,6 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { } if (UseJVMCICompiler) { - if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) { - jio_fprintf(defaultStream::error_stream(), - "Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n"); - return false; - } - FLAG_SET_DEFAULT(EnableJVMCI, true); if (BootstrapJVMCI && UseJVMCINativeLibrary) { jio_fprintf(defaultStream::error_stream(), "-XX:+BootstrapJVMCI is not compatible with -XX:+UseJVMCINativeLibrary\n"); return false;