124 static void release_monitors_owned_by_thread(TRAPS);
125 static void monitors_iterate(MonitorClosure* m);
126
127 // GC: we current use aggressive monitor deflation policy
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
140 // debugging
141 static void sanity_checks(const bool verbose,
142 const unsigned int cache_line_size,
143 int *error_cnt_ptr, int *warning_cnt_ptr);
144 static void verify() PRODUCT_RETURN;
145 static int verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
146
147 private:
148 enum { _BLOCKSIZE = 128 };
149 // global list of blocks of monitors
150 // gBlockList is really PaddedEnd<ObjectMonitor> *, but we don't
151 // want to expose the PaddedEnd template more than necessary.
152 static ObjectMonitor * volatile gBlockList;
153 // global monitor free list
154 static ObjectMonitor * volatile gFreeList;
155 // global monitor in-use list, for moribund threads,
156 // monitors they inflated need to be scanned for deflation
157 static ObjectMonitor * volatile gOmInUseList;
158 // count of entries in gOmInUseList
159 static int gOmInUseCount;
160 };
161
162 // ObjectLocker enforced balanced locking and can never thrown an
163 // IllegalMonitorStateException. However, a pending exception may
164 // have to pass through, and we must also be able to deal with
|
124 static void release_monitors_owned_by_thread(TRAPS);
125 static void monitors_iterate(MonitorClosure* m);
126
127 // GC: we current use aggressive monitor deflation policy
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
140 // debugging
141 static void sanity_checks(const bool verbose,
142 const unsigned int cache_line_size,
143 int *error_cnt_ptr, int *warning_cnt_ptr);
144 static int verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
145
146 private:
147 enum { _BLOCKSIZE = 128 };
148 // global list of blocks of monitors
149 // gBlockList is really PaddedEnd<ObjectMonitor> *, but we don't
150 // want to expose the PaddedEnd template more than necessary.
151 static ObjectMonitor * volatile gBlockList;
152 // global monitor free list
153 static ObjectMonitor * volatile gFreeList;
154 // global monitor in-use list, for moribund threads,
155 // monitors they inflated need to be scanned for deflation
156 static ObjectMonitor * volatile gOmInUseList;
157 // count of entries in gOmInUseList
158 static int gOmInUseCount;
159 };
160
161 // ObjectLocker enforced balanced locking and can never thrown an
162 // IllegalMonitorStateException. However, a pending exception may
163 // have to pass through, and we must also be able to deal with
|