Skip to content

Commit

Permalink
JDK-8340398: [JVMCI] Unintuitive behavior of UseJVMCICompiler option
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Zezula committed Sep 18, 2024
1 parent 6ff287a commit 78f5761
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/hotspot/share/jvmci/jvmci_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler)
CHECK_NOT_SET(LibJVMCICompilerThreadHidden, UseJVMCICompiler)

if (UseJVMCICompiler) {
if (EnableJVMCI) {
if (FLAG_IS_DEFAULT(UseJVMCINativeLibrary) && !UseJVMCINativeLibrary) {
char path[JVM_MAXPATHLEN];
if (os::dll_locate_lib(path, sizeof(path), Arguments::get_dll_dir(), JVMCI_SHARED_LIBRARY_NAME)) {
Expand All @@ -88,6 +88,9 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
FLAG_SET_DEFAULT(UseJVMCINativeLibrary, true);
}
}
}

if (UseJVMCICompiler) {
if (!FLAG_IS_DEFAULT(EnableJVMCI) && !EnableJVMCI) {
jio_fprintf(defaultStream::error_stream(),
"Improperly specified VM option UseJVMCICompiler: EnableJVMCI cannot be disabled\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@ static JVMCICompilerFactory getCompilerFactory(HotSpotJVMCIRuntime runtime) {
}
}
if (factory == null) {
String reason;
if (Services.IS_IN_NATIVE_IMAGE) {
throw runtime.exitHotSpotWithMessage(1, "JVMCI compiler '%s' not found in JVMCI native library.%n" +
reason = String.format("JVMCI compiler '%s' not found in JVMCI native library.%n" +
"Use -XX:-UseJVMCINativeLibrary when specifying a JVMCI compiler available on a class path with %s.%n",
compilerName, compPropertyName);
} else {
reason = String.format("JVMCI compiler '%s' specified by %s not found%n", compilerName, compPropertyName);
}
throw runtime.exitHotSpotWithMessage(1, "JVMCI compiler '%s' specified by %s not found%n", compilerName, compPropertyName);
factory = new DummyCompilerFactory(reason, runtime);
}
}
} else {
Expand Down

0 comments on commit 78f5761

Please sign in to comment.