< prev index next >

src/hotspot/share/runtime/objectMonitor.hpp

Print this page
rev 57232 : [mq]: 8236035.patch.cr0


 215   // reference. The latter avoids an AGI (Address Generation Interlock)
 216   // stall so the helper macro adjusts the offset value that is returned
 217   // to the ObjectMonitor reference manipulation code:
 218   //
 219   #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \
 220     ((ObjectMonitor::f ## _offset_in_bytes()) - markWord::monitor_value)
 221 
 222   markWord           header() const;
 223   volatile markWord* header_addr();
 224   void               set_header(markWord hdr);
 225 
 226   intptr_t is_busy() const {
 227     // TODO-FIXME: assert _owner == null implies _recursions = 0
 228     return _contentions|_waiters|intptr_t(_owner)|intptr_t(_cxq)|intptr_t(_EntryList);
 229   }
 230   const char* is_busy_to_string(stringStream* ss);
 231 
 232   intptr_t  is_entered(Thread* current) const;
 233 
 234   void*     owner() const;
 235   void      set_owner(void* owner);








 236 
 237   jint      waiters() const;
 238 
 239   jint      contentions() const;
 240   intx      recursions() const                                         { return _recursions; }
 241 
 242   // JVM/TI GetObjectMonitorUsage() needs this:
 243   ObjectWaiter* first_waiter()                                         { return _WaitSet; }
 244   ObjectWaiter* next_waiter(ObjectWaiter* o)                           { return o->_next; }
 245   Thread* thread_of_waiter(ObjectWaiter* o)                            { return o->_thread; }
 246 
 247  protected:
 248   // We don't typically expect or want the ctors or dtors to run.
 249   // normal ObjectMonitors are type-stable and immortal.
 250   ObjectMonitor() { ::memset((void*)this, 0, sizeof(*this)); }
 251 
 252   ~ObjectMonitor() {
 253     // TODO: Add asserts ...
 254     // _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
 255     // _contentions == 0 _EntryList  == NULL etc




 215   // reference. The latter avoids an AGI (Address Generation Interlock)
 216   // stall so the helper macro adjusts the offset value that is returned
 217   // to the ObjectMonitor reference manipulation code:
 218   //
 219   #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \
 220     ((ObjectMonitor::f ## _offset_in_bytes()) - markWord::monitor_value)
 221 
 222   markWord           header() const;
 223   volatile markWord* header_addr();
 224   void               set_header(markWord hdr);
 225 
 226   intptr_t is_busy() const {
 227     // TODO-FIXME: assert _owner == null implies _recursions = 0
 228     return _contentions|_waiters|intptr_t(_owner)|intptr_t(_cxq)|intptr_t(_EntryList);
 229   }
 230   const char* is_busy_to_string(stringStream* ss);
 231 
 232   intptr_t  is_entered(Thread* current) const;
 233 
 234   void*     owner() const;
 235   // Clear _owner field; current value must match old_value.
 236   void      release_clear_owner_with_barrier(void* old_value, bool needs_fence);
 237   // Simply set _owner field to new_value; current value must match old_value.
 238   void      simply_set_owner_from(void* old_value, void* new_value);
 239   // Simply set _owner field to self; current value must match basic_lock_p.
 240   void      simply_set_owner_from_BasicLock(void* basic_lock_p, Thread* self);
 241   // Try to set _owner field to new_value if the current value matches
 242   // old_value. Otherwise, does not change the _owner field.
 243   void*     try_set_owner_from(void* old_value, void* new_value);
 244 
 245   jint      waiters() const;
 246 
 247   jint      contentions() const;
 248   intx      recursions() const                                         { return _recursions; }
 249 
 250   // JVM/TI GetObjectMonitorUsage() needs this:
 251   ObjectWaiter* first_waiter()                                         { return _WaitSet; }
 252   ObjectWaiter* next_waiter(ObjectWaiter* o)                           { return o->_next; }
 253   Thread* thread_of_waiter(ObjectWaiter* o)                            { return o->_thread; }
 254 
 255  protected:
 256   // We don't typically expect or want the ctors or dtors to run.
 257   // normal ObjectMonitors are type-stable and immortal.
 258   ObjectMonitor() { ::memset((void*)this, 0, sizeof(*this)); }
 259 
 260   ~ObjectMonitor() {
 261     // TODO: Add asserts ...
 262     // _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
 263     // _contentions == 0 _EntryList  == NULL etc


< prev index next >