Skip to content

Commit

Permalink
disentangle EnableJVMCI and UseJVMCICompiler
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed Sep 22, 2024
1 parent 0b3f2e6 commit b0b2382
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions src/hotspot/share/jvmci/jvmci_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "compiler/compilerDefinitions.hpp"
#include "gc/shared/gcConfig.hpp"
#include "jvm.h"
#include "jvmci/jvmci.hpp"
#include "jvmci/jvmci_globals.hpp"
#include "logging/log.hpp"
#include "runtime/arguments.hpp"
Expand Down Expand Up @@ -79,15 +80,15 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
CHECK_NOT_SET(JVMCIHostThreads, UseJVMCICompiler)
CHECK_NOT_SET(LibJVMCICompilerThreadHidden, UseJVMCICompiler)

if ((UseJVMCICompiler || EnableJVMCI) &&
FLAG_IS_DEFAULT(UseJVMCINativeLibrary) &&
!UseJVMCINativeLibrary && JVMCI::shared_library_exists()) {
// If a JVMCI native library is present,
// we enable UseJVMCINativeLibrary by default.
FLAG_SET_DEFAULT(UseJVMCINativeLibrary, true);
}

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 a JVMCI native library is present,
// we enable UseJVMCINativeLibrary by default.
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");
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
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/deoptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ bool Deoptimization::deoptimize_objects_internal(JavaThread* thread, GrowableArr
RegisterMap map(chunk->at(0)->register_map());
bool deoptimized_objects = false;

bool const jvmci_enabled = JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false);
bool const jvmci_enabled = JVMCI_ONLY(EnableJVMCI) NOT_JVMCI(false);

// Reallocate the non-escaping objects and restore their fields.
if (jvmci_enabled COMPILER2_PRESENT(|| (DoEscapeAnalysis && EliminateAllocations)
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/escapeBarrier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class EscapeBarrier : StackObj {
// Revert ea based optimizations for given deoptee thread
EscapeBarrier(bool barrier_active, JavaThread* calling_thread, JavaThread* deoptee_thread)
: _calling_thread(calling_thread), _deoptee_thread(deoptee_thread),
_barrier_active(barrier_active && (JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false)
_barrier_active(barrier_active && (JVMCI_ONLY(EnableJVMCI) NOT_JVMCI(false)
COMPILER2_PRESENT(|| DoEscapeAnalysis)))
{
if (_barrier_active) sync_and_suspend_one();
Expand All @@ -80,7 +80,7 @@ class EscapeBarrier : StackObj {
// Revert ea based optimizations for all java threads
EscapeBarrier(bool barrier_active, JavaThread* calling_thread)
: _calling_thread(calling_thread), _deoptee_thread(nullptr),
_barrier_active(barrier_active && (JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false)
_barrier_active(barrier_active && (JVMCI_ONLY(EnableJVMCI) NOT_JVMCI(false)
COMPILER2_PRESENT(|| DoEscapeAnalysis)))
{
if (_barrier_active) sync_and_suspend_all();
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/sharedRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ void SharedRuntime::throw_and_post_jvmti_exception(JavaThread* current, Handle h
}

#if INCLUDE_JVMCI
if (EnableJVMCI && UseJVMCICompiler) {
if (EnableJVMCI) {
vframeStream vfst(current, true);
methodHandle method = methodHandle(current, vfst.method());
int bci = vfst.bci();
Expand Down

0 comments on commit b0b2382

Please sign in to comment.