8338538: [JVMCI] Allow HotSpotJVMCIRuntime#getJObjectValue to be called by a HotSpot CompileBroker compiler thread
Reviewed-by: dnsimon
This commit is contained in:
parent
3f00da84b3
commit
a15af6998e
@ -710,8 +710,10 @@ 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 current JNI handle scope is not the top-most JNIHandleBlock as handles
|
||||
// in that scope are only released when the thread exits.
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user