< prev index next >

src/hotspot/share/runtime/objectMonitor.hpp

Print this page
rev 57560 : imported patch 8236035.patch.cr0
rev 57561 : dholmes CR - rename simply_set_owner_from() -> set_owner_from() and simply_set_owner_from_BasicLock() -> set_owner_from_BasicLock(); rename release_clear_owner_with_barrier() -> release_clear_owner() and refactor barrier code back into the call sites.


 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() {




 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(void* old_value);
 237   // Simply set _owner field to new_value; current value must match old_value.
 238   void      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      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() {


< prev index next >