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;