8247281: migrate ObjectMonitor::_object to OopStorage

Co-authored-by: Erik Österlund <erik.osterlund@oracle.com>
Co-authored-by: Daniel Daugherty <daniel.daugherty@oracle.com>
Reviewed-by: eosterlund, coleenp, dholmes, stefank, kbarrett, rkennke, sspitsyn
This commit is contained in:
Daniel D. Daugherty 2020-09-21 22:12:07 +00:00
parent f800af978c
commit d8921ed573
37 changed files with 211 additions and 344 deletions

View file

@ -889,10 +889,6 @@ void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
// Do oop for ThreadShadow
f->do_oop((oop*)&_pending_exception);
handle_area()->oops_do(f);
// We scan thread local monitor lists here, and the remaining global
// monitors in ObjectSynchronizer::oops_do().
ObjectSynchronizer::thread_local_used_oops_do(this, f);
}
void Thread::metadata_handles_do(void f(Metadata*)) {
@ -2217,11 +2213,6 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
thread_name = os::strdup(get_thread_name());
}
// We must flush any deferred card marks and other various GC barrier
// related buffers (e.g. G1 SATB buffer and G1 dirty card queue buffer)
// before removing a thread from the list of active threads.
BarrierSet::barrier_set()->on_thread_detach(this);
log_info(os, thread)("JavaThread %s (tid: " UINTX_FORMAT ").",
exit_type == JavaThread::normal_exit ? "exiting" : "detaching",
os::current_thread_id());
@ -2269,8 +2260,6 @@ void JavaThread::cleanup_failed_attach_current_thread(bool is_daemon) {
tlab().retire();
}
BarrierSet::barrier_set()->on_thread_detach(this);
Threads::remove(this, is_daemon);
this->smr_delete();
}
@ -4598,6 +4587,13 @@ void Threads::remove(JavaThread* p, bool is_daemon) {
// Reclaim the ObjectMonitors from the om_in_use_list and om_free_list of the moribund thread.
ObjectSynchronizer::om_flush(p);
// We must flush any deferred card marks and other various GC barrier
// related buffers (e.g. G1 SATB buffer and G1 dirty card queue buffer)
// before removing a thread from the list of active threads.
// This must be done after ObjectSynchronizer::om_flush(), as GC barriers
// are used in om_flush().
BarrierSet::barrier_set()->on_thread_detach(p);
// Extra scope needed for Thread_lock, so we can check
// that we do not remove thread without safepoint code notice
{ MonitorLocker ml(Threads_lock);