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
9 changes: 7 additions & 2 deletions src/hotspot/share/jvmci/jvmci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void* JVMCI::get_shared_library(char*& path, bool load) {
return _shared_library_handle;
}

void JVMCI::initialize_compiler(TRAPS) {
void JVMCI::initialize_compiler_in_create_vm(TRAPS) {
if (JVMCILibDumpJNIConfig) {
JNIJVMCI::initialize_ids(nullptr);
ShouldNotReachHere();
Expand All @@ -162,7 +162,12 @@ void JVMCI::initialize_compiler(TRAPS) {
} else {
runtime = JVMCI::java_runtime();
}
runtime->call_getCompiler(CHECK);

JVMCIENV_FROM_THREAD(THREAD);
JVMCIENV->check_init(CHECK);
JVMCIObject jvmciRuntime = runtime->get_HotSpotJVMCIRuntime(JVMCI_CHECK);
runtime->initialize(JVMCI_CHECK);
JVMCIENV->call_HotSpotJVMCIRuntime_getCompiler(jvmciRuntime, JVMCI_CHECK);
}

void JVMCI::initialize_globals() {
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/jvmci/jvmci.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,8 @@ class JVMCI : public AllStatic {

static void initialize_globals();

// Called to force initialization of the JVMCI compiler
// early in VM startup.
static void initialize_compiler(TRAPS);
// Initializes the JVMCI compiler during VM startup.
static void initialize_compiler_in_create_vm(TRAPS);

// Ensures the boxing cache classes (e.g., java.lang.Integer.IntegerCache) are initialized.
static void ensure_box_caches_initialized(TRAPS);
Expand Down
5 changes: 1 addition & 4 deletions src/hotspot/share/jvmci/jvmciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,9 @@ void JVMCIEnv::check_init(TRAPS) {
if (_init_error == JNI_OK) {
return;
}
if (_init_error == JNI_ENOMEM) {
THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), "JNI_ENOMEM creating or attaching to libjvmci");
}
stringStream st;
st.print("Error creating or attaching to libjvmci (err: %d, description: %s)",
_init_error, _init_error_msg == nullptr ? "unknown" : _init_error_msg);
_init_error, _init_error_msg != nullptr ? _init_error_msg : (_init_error == JNI_ENOMEM ? "JNI_ENOMEM" : "none"));
THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), st.freeze());
}

Expand Down
8 changes: 0 additions & 8 deletions src/hotspot/share/jvmci/jvmciRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,14 +743,6 @@ JVM_ENTRY_NO_ENV(jlong, JVM_ReadSystemPropertiesInfo(JNIEnv *env, jclass c, jint
JVM_END


void JVMCIRuntime::call_getCompiler(TRAPS) {
JVMCIENV_FROM_THREAD(THREAD);
JVMCIENV->check_init(CHECK);
JVMCIObject jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(JVMCI_CHECK);
initialize(JVMCI_CHECK);
JVMCIENV->call_HotSpotJVMCIRuntime_getCompiler(jvmciRuntime, JVMCI_CHECK);
}

void JVMCINMethodData::initialize(int nmethod_mirror_index,
int nmethod_entry_patch_offset,
const char* nmethod_mirror_name,
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/jvmci/jvmciRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ class JVMCIRuntime: public CHeapObj<mtJVMCI> {
// Explicitly initialize HotSpotJVMCIRuntime itself
void initialize_HotSpotJVMCIRuntime(JVMCI_TRAPS);

void call_getCompiler(TRAPS);

// Shuts down this runtime by calling HotSpotJVMCIRuntime.shutdown().
// If this is the last thread attached to this runtime, then
// `_HotSpotJVMCIRuntime_instance` is set to null and `_init_state`
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {

#if INCLUDE_JVMCI
if (force_JVMCI_initialization) {
JVMCI::initialize_compiler(CHECK_JNI_ERR);
JVMCI::initialize_compiler_in_create_vm(CHECK_JNI_ERR);
}
#endif

Expand Down