8180175: ObjectSynchronizer only needs to iterate in-use monitors

When using -XX:+MonitorInUseLists, then only iterate in-use monitors.

Reviewed-by: zgu, dholmes, rehn
This commit is contained in:
Roman Kennke 2017-05-17 23:36:19 +02:00
parent ae8a3dd115
commit 553d1e815b
3 changed files with 47 additions and 0 deletions

View file

@ -792,6 +792,12 @@ void Thread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
// Do oop for ThreadShadow
f->do_oop((oop*)&_pending_exception);
handle_area()->oops_do(f);
if (MonitorInUseLists) {
// When using thread local monitor lists, we scan them 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*)) {