mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
5103339: Strengthen NoSafepointVerifier
Add NSV check at possible safepoint transition or places that could take out locks. Consolidate with clearing unhandled oops. Reviewed-by: dholmes, rehn
This commit is contained in:
parent
af89550878
commit
d1ca6221a4
16 changed files with 50 additions and 51 deletions
|
@ -87,13 +87,16 @@ class ThreadStateTransition : public StackObj {
|
|||
assert(from != _thread_in_native, "use transition_from_native");
|
||||
assert((from & 1) == 0 && (to & 1) == 0, "odd numbers are transitions states");
|
||||
assert(thread->thread_state() == from, "coming from wrong thread state");
|
||||
|
||||
// Check NoSafepointVerifier
|
||||
// This also clears unhandled oops if CheckUnhandledOops is used.
|
||||
thread->check_possible_safepoint();
|
||||
|
||||
// Change to transition state and ensure it is seen by the VM thread.
|
||||
thread->set_thread_state_fence((JavaThreadState)(from + 1));
|
||||
|
||||
SafepointMechanism::block_if_requested(thread);
|
||||
thread->set_thread_state(to);
|
||||
|
||||
CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
|
||||
}
|
||||
|
||||
// Same as above, but assumes from = _thread_in_Java. This is simpler, since we
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue