Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/hotspot/share/jvmci/jvmci_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
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];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check for enabling UseJVMCINativeLibrary should really be:

   if (UseJVMCICompiler) {
     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)) {
+      if (JVMCI::shared_library_exists()) {
         // If a JVMCI native library is present,

but I will address that as part of JDK-8340576.

if (os::dll_locate_lib(path, sizeof(path), Arguments::get_dll_dir(), JVMCI_SHARED_LIBRARY_NAME)) {
Expand All @@ -88,12 +97,9 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
FLAG_SET_DEFAULT(UseJVMCINativeLibrary, true);
}
}
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 (UseJVMCICompiler) {
if (BootstrapJVMCI && UseJVMCINativeLibrary) {
jio_fprintf(defaultStream::error_stream(), "-XX:+BootstrapJVMCI is not compatible with -XX:+UseJVMCINativeLibrary\n");
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/jvmci/jvmci_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class fileStream;
product(bool, UseJVMCINativeLibrary, false, EXPERIMENTAL, \
"Execute JVMCI Java code from a shared library (\"libjvmci\") " \
"instead of loading it from class files and executing it " \
"on the HotSpot heap. Defaults to true if EnableJVMCIProduct is " \
"on the HotSpot heap. Defaults to true if EnableJVMCI is " \
"true and a JVMCI native library is available.") \
\
product(double, JVMCINativeLibraryThreadFraction, 0.33, EXPERIMENTAL, \
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