218 inline void JavaThread::set_terminated(TerminatedTypes t) {
219 Atomic::release_store(&_terminated, t);
220 }
221
222 inline bool JavaThread::is_active_Java_thread() const {
223 return on_thread_list() && !is_terminated();
224 }
225
226 // Allow tracking of class initialization monitor use
227 inline void JavaThread::set_class_to_be_initialized(InstanceKlass* k) {
228 assert((k == nullptr && _class_to_be_initialized != nullptr) ||
229 (k != nullptr && _class_to_be_initialized == nullptr), "incorrect usage");
230 assert(this == Thread::current(), "Only the current thread can set this field");
231 _class_to_be_initialized = k;
232 }
233
234 inline InstanceKlass* JavaThread::class_to_be_initialized() const {
235 return _class_to_be_initialized;
236 }
237
238 inline void JavaThread::set_class_being_initialized(InstanceKlass* k) {
239 assert(k != nullptr || _class_being_initialized != nullptr, "incorrect usage");
240 assert(this == Thread::current(), "Only the current thread can set this field");
241 _class_being_initialized = k;
242 }
243
244 inline InstanceKlass* JavaThread::class_being_initialized() const {
245 return _class_being_initialized;
246 }
247
248 inline void JavaThread::om_set_monitor_cache(ObjectMonitor* monitor) {
249 assert(UseObjectMonitorTable, "must be");
250 assert(monitor != nullptr, "use om_clear_monitor_cache to clear");
251 assert(this == current() || monitor->has_owner(this), "only add owned monitors for other threads");
252 assert(this == current() || is_obj_deopt_suspend(), "thread must not run concurrently");
253
254 _om_cache.set_monitor(monitor);
255 }
256
257 inline void JavaThread::om_clear_monitor_cache() {
258 if (UseObjectMonitorTable) {
259 _om_cache.clear();
260 }
261 }
262
263 inline ObjectMonitor* JavaThread::om_get_from_monitor_cache(oop obj) {
264 assert(obj != nullptr, "do not look for null objects");
|
218 inline void JavaThread::set_terminated(TerminatedTypes t) {
219 Atomic::release_store(&_terminated, t);
220 }
221
222 inline bool JavaThread::is_active_Java_thread() const {
223 return on_thread_list() && !is_terminated();
224 }
225
226 // Allow tracking of class initialization monitor use
227 inline void JavaThread::set_class_to_be_initialized(InstanceKlass* k) {
228 assert((k == nullptr && _class_to_be_initialized != nullptr) ||
229 (k != nullptr && _class_to_be_initialized == nullptr), "incorrect usage");
230 assert(this == Thread::current(), "Only the current thread can set this field");
231 _class_to_be_initialized = k;
232 }
233
234 inline InstanceKlass* JavaThread::class_to_be_initialized() const {
235 return _class_to_be_initialized;
236 }
237
238 inline InstanceKlass* JavaThread::set_class_being_initialized(InstanceKlass* k) {
239 assert(this == Thread::current(), "Only the current thread can set this field");
240 InstanceKlass* prev = _class_being_initialized;
241 _class_being_initialized = k;
242 return prev;
243 }
244
245 inline InstanceKlass* JavaThread::class_being_initialized() const {
246 assert(this == Thread::current(), "Only the current thread can get this field");
247 return _class_being_initialized;
248 }
249
250 inline void JavaThread::om_set_monitor_cache(ObjectMonitor* monitor) {
251 assert(UseObjectMonitorTable, "must be");
252 assert(monitor != nullptr, "use om_clear_monitor_cache to clear");
253 assert(this == current() || monitor->has_owner(this), "only add owned monitors for other threads");
254 assert(this == current() || is_obj_deopt_suspend(), "thread must not run concurrently");
255
256 _om_cache.set_monitor(monitor);
257 }
258
259 inline void JavaThread::om_clear_monitor_cache() {
260 if (UseObjectMonitorTable) {
261 _om_cache.clear();
262 }
263 }
264
265 inline ObjectMonitor* JavaThread::om_get_from_monitor_cache(oop obj) {
266 assert(obj != nullptr, "do not look for null objects");
|