128 // Basically we deflate all monitors that are not busy.
129 // An adaptive profile-based deflation policy could be used if needed
130 static void deflate_idle_monitors();
131 // For a given monitor list: global or per-thread, deflate idle monitors
132 static int deflate_monitor_list(ObjectMonitor** listheadp,
133 ObjectMonitor** freeHeadp,
134 ObjectMonitor** freeTailp);
135 static bool deflate_monitor(ObjectMonitor* mid, oop obj,
136 ObjectMonitor** freeHeadp,
137 ObjectMonitor** freeTailp);
138 static void oops_do(OopClosure* f);
139 // Process oops in thread local used monitors
140 static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
141
142 // debugging
143 static void sanity_checks(const bool verbose,
144 const unsigned int cache_line_size,
145 int *error_cnt_ptr, int *warning_cnt_ptr);
146 static int verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
147
148 private:
149 enum { _BLOCKSIZE = 128 };
150 // global list of blocks of monitors
151 // gBlockList is really PaddedEnd<ObjectMonitor> *, but we don't
152 // want to expose the PaddedEnd template more than necessary.
153 static ObjectMonitor * volatile gBlockList;
154 // global monitor free list
155 static ObjectMonitor * volatile gFreeList;
156 // global monitor in-use list, for moribund threads,
157 // monitors they inflated need to be scanned for deflation
158 static ObjectMonitor * volatile gOmInUseList;
159 // count of entries in gOmInUseList
160 static int gOmInUseCount;
161
162 // Process oops in all monitors
163 static void global_oops_do(OopClosure* f);
164 // Process oops in all global used monitors (i.e. moribund thread's monitors)
165 static void global_used_oops_do(OopClosure* f);
166 // Process oops in monitors on the given list
167 static void list_oops_do(ObjectMonitor* list, OopClosure* f);
|
128 // Basically we deflate all monitors that are not busy.
129 // An adaptive profile-based deflation policy could be used if needed
130 static void deflate_idle_monitors();
131 // For a given monitor list: global or per-thread, deflate idle monitors
132 static int deflate_monitor_list(ObjectMonitor** listheadp,
133 ObjectMonitor** freeHeadp,
134 ObjectMonitor** freeTailp);
135 static bool deflate_monitor(ObjectMonitor* mid, oop obj,
136 ObjectMonitor** freeHeadp,
137 ObjectMonitor** freeTailp);
138 static void oops_do(OopClosure* f);
139 // Process oops in thread local used monitors
140 static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
141
142 // debugging
143 static void sanity_checks(const bool verbose,
144 const unsigned int cache_line_size,
145 int *error_cnt_ptr, int *warning_cnt_ptr);
146 static int verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
147
148 static bool is_cleanup_needed();
149
150 private:
151 enum { _BLOCKSIZE = 128 };
152 // global list of blocks of monitors
153 // gBlockList is really PaddedEnd<ObjectMonitor> *, but we don't
154 // want to expose the PaddedEnd template more than necessary.
155 static ObjectMonitor * volatile gBlockList;
156 // global monitor free list
157 static ObjectMonitor * volatile gFreeList;
158 // global monitor in-use list, for moribund threads,
159 // monitors they inflated need to be scanned for deflation
160 static ObjectMonitor * volatile gOmInUseList;
161 // count of entries in gOmInUseList
162 static int gOmInUseCount;
163
164 // Process oops in all monitors
165 static void global_oops_do(OopClosure* f);
166 // Process oops in all global used monitors (i.e. moribund thread's monitors)
167 static void global_used_oops_do(OopClosure* f);
168 // Process oops in monitors on the given list
169 static void list_oops_do(ObjectMonitor* list, OopClosure* f);
|