# HG changeset patch # User dholmes # Date 1564370047 14400 # Node ID 9af2749af9fc0e06a230d7c5974929c0db9a0be5 # Parent 5e637f790bb815d00ca5883a7ded3127e6a74667 8221205: Obsolete AllowJNIEnvProxy Reviewed-by: hseigel, dcubed diff -r 5e637f790bb8 -r 9af2749af9fc src/hotspot/share/runtime/globals.hpp --- a/src/hotspot/share/runtime/globals.hpp Sat Jul 27 14:49:16 2019 -0700 +++ b/src/hotspot/share/runtime/globals.hpp Sun Jul 28 23:14:07 2019 -0400 @@ -761,9 +761,6 @@ "Use signal-chaining to invoke signal handlers installed " \ "by the application (Solaris & Linux only)") \ \ - product(bool, AllowJNIEnvProxy, false, \ - "(Deprecated) Allow JNIEnv proxies for jdbx") \ - \ product(bool, RestoreMXCSROnJNICalls, false, \ "Restore MXCSR when returning from JNI calls") \ \ diff -r 5e637f790bb8 -r 9af2749af9fc src/hotspot/share/runtime/thread.cpp --- a/src/hotspot/share/runtime/thread.cpp Sat Jul 27 14:49:16 2019 -0700 +++ b/src/hotspot/share/runtime/thread.cpp Sun Jul 28 23:14:07 2019 -0400 @@ -2344,14 +2344,9 @@ } void JavaThread::handle_special_runtime_exit_condition(bool check_asyncs) { - // + // Check for pending external suspend. - // If JNIEnv proxies are allowed, don't self-suspend if the target - // thread is not the current thread. In older versions of jdbx, jdbx - // threads could call into the VM with another thread's JNIEnv so we - // can be here operating on behalf of a suspended thread (4432884). - bool do_self_suspend = is_external_suspend_with_lock(); - if (do_self_suspend && (!AllowJNIEnvProxy || this == JavaThread::current())) { + if (is_external_suspend_with_lock()) { frame_anchor()->make_walkable(this); java_suspend_self_with_safepoint_check(); } @@ -2576,19 +2571,12 @@ void JavaThread::check_safepoint_and_suspend_for_native_trans(JavaThread *thread) { assert(thread->thread_state() == _thread_in_native_trans, "wrong state"); - JavaThread *curJT = JavaThread::current(); - bool do_self_suspend = thread->is_external_suspend(); - - assert(!curJT->has_last_Java_frame() || curJT->frame_anchor()->walkable(), "Unwalkable stack in native->vm transition"); - - // If JNIEnv proxies are allowed, don't self-suspend if the target - // thread is not the current thread. In older versions of jdbx, jdbx - // threads could call into the VM with another thread's JNIEnv so we - // can be here operating on behalf of a suspended thread (4432884). - if (do_self_suspend && (!AllowJNIEnvProxy || curJT == thread)) { + assert(!thread->has_last_Java_frame() || thread->frame_anchor()->walkable(), "Unwalkable stack in native->vm transition"); + + if (thread->is_external_suspend()) { thread->java_suspend_self_with_safepoint_check(); } else { - SafepointMechanism::block_if_requested(curJT); + SafepointMechanism::block_if_requested(thread); } JFR_ONLY(SUSPEND_THREAD_CONDITIONAL(thread);)