mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8233343: Deprecate -XX:+CriticalJNINatives flag which implements JavaCritical native functions
Reviewed-by: rehn, mdoerr, zgu
This commit is contained in:
parent
615b759edd
commit
56ea490f1e
18 changed files with 148 additions and 1204 deletions
|
@ -673,39 +673,6 @@ bool SafepointSynchronize::handshake_safe(JavaThread *thread) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// See if the thread is running inside a lazy critical native and
|
||||
// update the thread critical count if so. Also set a suspend flag to
|
||||
// cause the native wrapper to return into the JVM to do the unlock
|
||||
// once the native finishes.
|
||||
static void check_for_lazy_critical_native(JavaThread *thread, JavaThreadState state) {
|
||||
if (state == _thread_in_native &&
|
||||
thread->has_last_Java_frame() &&
|
||||
thread->frame_anchor()->walkable()) {
|
||||
// This thread might be in a critical native nmethod so look at
|
||||
// the top of the stack and increment the critical count if it
|
||||
// is.
|
||||
frame wrapper_frame = thread->last_frame();
|
||||
CodeBlob* stub_cb = wrapper_frame.cb();
|
||||
if (stub_cb != NULL &&
|
||||
stub_cb->is_nmethod() &&
|
||||
stub_cb->as_nmethod_or_null()->is_lazy_critical_native()) {
|
||||
// A thread could potentially be in a critical native across
|
||||
// more than one safepoint, so only update the critical state on
|
||||
// the first one. When it returns it will perform the unlock.
|
||||
if (!thread->do_critical_native_unlock()) {
|
||||
#ifdef ASSERT
|
||||
if (!thread->in_critical()) {
|
||||
GCLocker::increment_debug_jni_lock_count();
|
||||
}
|
||||
#endif
|
||||
thread->enter_critical();
|
||||
// Make sure the native wrapper calls back on return to
|
||||
// perform the needed critical unlock.
|
||||
thread->set_critical_native_unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------
|
||||
// Implementation of Safepoint blocking point
|
||||
|
@ -899,7 +866,6 @@ void ThreadSafepointState::examine_state_of_thread(uint64_t safepoint_count) {
|
|||
}
|
||||
|
||||
if (safepoint_safe_with(_thread, stable_state)) {
|
||||
check_for_lazy_critical_native(_thread, stable_state);
|
||||
account_safe_thread();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue