8221205: Obsolete AllowJNIEnvProxy

Reviewed-by: hseigel, dcubed
This commit is contained in:
David Holmes 2019-07-28 23:14:07 -04:00
parent 19ec64630a
commit 3e45ca1ad7
2 changed files with 5 additions and 20 deletions

View file

@ -761,9 +761,6 @@ const size_t minimumSymbolTableSize = 1024;
"Use signal-chaining to invoke signal handlers installed " \ "Use signal-chaining to invoke signal handlers installed " \
"by the application (Solaris & Linux only)") \ "by the application (Solaris & Linux only)") \
\ \
product(bool, AllowJNIEnvProxy, false, \
"(Deprecated) Allow JNIEnv proxies for jdbx") \
\
product(bool, RestoreMXCSROnJNICalls, false, \ product(bool, RestoreMXCSROnJNICalls, false, \
"Restore MXCSR when returning from JNI calls") \ "Restore MXCSR when returning from JNI calls") \
\ \

View file

@ -2344,14 +2344,9 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) {
} }
void JavaThread::handle_special_runtime_exit_condition(bool check_asyncs) { void JavaThread::handle_special_runtime_exit_condition(bool check_asyncs) {
//
// Check for pending external suspend. // Check for pending external suspend.
// If JNIEnv proxies are allowed, don't self-suspend if the target if (is_external_suspend_with_lock()) {
// 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())) {
frame_anchor()->make_walkable(this); frame_anchor()->make_walkable(this);
java_suspend_self_with_safepoint_check(); java_suspend_self_with_safepoint_check();
} }
@ -2576,19 +2571,12 @@ void JavaThread::verify_not_published() {
void JavaThread::check_safepoint_and_suspend_for_native_trans(JavaThread *thread) { void JavaThread::check_safepoint_and_suspend_for_native_trans(JavaThread *thread) {
assert(thread->thread_state() == _thread_in_native_trans, "wrong state"); assert(thread->thread_state() == _thread_in_native_trans, "wrong state");
JavaThread *curJT = JavaThread::current(); assert(!thread->has_last_Java_frame() || thread->frame_anchor()->walkable(), "Unwalkable stack in native->vm transition");
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 (thread->is_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).
if (do_self_suspend && (!AllowJNIEnvProxy || curJT == thread)) {
thread->java_suspend_self_with_safepoint_check(); thread->java_suspend_self_with_safepoint_check();
} else { } else {
SafepointMechanism::block_if_requested(curJT); SafepointMechanism::block_if_requested(thread);
} }
JFR_ONLY(SUSPEND_THREAD_CONDITIONAL(thread);) JFR_ONLY(SUSPEND_THREAD_CONDITIONAL(thread);)