Skip to content

Commit

Permalink
JDK-8338538: [JVMCI] Allow HotSpotJVMCIRuntime#getJObjectValue to be …
Browse files Browse the repository at this point in the history
…called by host compiler threads.
  • Loading branch information
Tomas Zezula committed Aug 18, 2024
1 parent 8635642 commit 0301024
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,9 @@ C2V_END

C2V_VMENTRY_0(jlong, getJObjectValue, (JNIEnv* env, jobject, jobject constant_jobject))
requireNotInHotSpot("getJObjectValue", JVMCI_CHECK_0);
if (!THREAD->has_last_Java_frame()) {
JVMCI_THROW_MSG_0(IllegalStateException, err_msg("Cannot call getJObjectValue without Java frame anchor"));
// Ensure that we are not using the top-most JNIHandleBlock, which is never released.
if (!THREAD->has_last_Java_frame() && THREAD->active_handles()->pop_frame_link() == nullptr) {
JVMCI_THROW_MSG_0(IllegalStateException, err_msg("Cannot call getJObjectValue without Java frame anchor or a pushed JNI handle block"));
}
JVMCIObject constant = JVMCIENV->wrap(constant_jobject);
Handle constant_value = JVMCIENV->asConstant(constant, JVMCI_CHECK_0);
Expand Down

0 comments on commit 0301024

Please sign in to comment.