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

@ -136,6 +136,8 @@ class ObjectSynchronizer : AllStatic {
ObjectMonitor** freeHeadp,
ObjectMonitor** freeTailp);
static void oops_do(OopClosure* f);
// Process oops in thread local used monitors
static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
// debugging
static void sanity_checks(const bool verbose,
@ -156,6 +158,14 @@ class ObjectSynchronizer : AllStatic {
static ObjectMonitor * volatile gOmInUseList;
// count of entries in gOmInUseList
static int gOmInUseCount;
// Process oops in all monitors
static void global_oops_do(OopClosure* f);
// Process oops in all global used monitors (i.e. moribund thread's monitors)
static void global_used_oops_do(OopClosure* f);
// Process oops in monitors on the given list
static void list_oops_do(ObjectMonitor* list, OopClosure* f);
};
// ObjectLocker enforced balanced locking and can never thrown an