< prev index next >

src/hotspot/share/runtime/objectMonitor.inline.hpp

Print this page
rev 58110 : v2.09a with 8235795, 8235931 and 8236035 extracted; rebased to jdk-14+28; merge with 8236035.patch.cr1; merge with 8235795.patch.cr1; merge with 8236035.patch.cr2; merge with 8235795.patch.cr2; merge with 8235795.patch.cr3.
rev 58111 : See CR9-to-CR10-changes; merge with jdk-15+11.


  72   jint l_ref_count = ref_count();
  73 #endif
  74   assert(l_ref_count == 0, "must be 0: l_ref_count=%d, ref_count=%d", l_ref_count, ref_count());
  75 
  76   Atomic::store(&_header, markWord::zero());
  77 
  78   clear_using_JT();
  79 }
  80 
  81 inline void ObjectMonitor::clear_using_JT() {
  82   // Unlike other *_using_JT() functions, we cannot assert
  83   // AsyncDeflateIdleMonitors or Thread::current()->is_Java_thread()
  84   // because clear() calls this function for the rest of its checks.
  85 
  86   if (AsyncDeflateIdleMonitors) {
  87     // Async deflation protocol uses the header, owner and ref_count
  88     // fields. While the ObjectMonitor being deflated is on the global free
  89     // list, we leave those three fields alone; owner == DEFLATER_MARKER
  90     // and ref_count < 0 will force any racing threads to retry. The
  91     // header field is used by install_displaced_markword_in_object()
  92     // in the last part of the deflation protocol so we cannot check
  93     // its value here.
  94     guarantee(_owner == NULL || _owner == DEFLATER_MARKER,
  95               "must be NULL or DEFLATER_MARKER: owner=" INTPTR_FORMAT,
  96               p2i(_owner));
  97     jint l_ref_count = ref_count();
  98     guarantee(l_ref_count <= 0, "must be <= 0: l_ref_count=%d, ref_count=%d", l_ref_count, ref_count());
  99   }
 100   assert(_contentions == 0, "must be 0: contentions=%d", _contentions);
 101   assert(_waiters == 0, "must be 0: waiters=%d", _waiters);
 102   assert(_recursions == 0, "must be 0: recursions=" INTX_FORMAT, _recursions);
 103   assert(_object != NULL, "must be non-NULL");
 104 
 105   set_allocation_state(Free);
 106   _object = NULL;
 107 }
 108 
 109 inline void* ObjectMonitor::object() const {
 110   return _object;
 111 }
 112 
 113 inline void* ObjectMonitor::object_addr() {




  72   jint l_ref_count = ref_count();
  73 #endif
  74   assert(l_ref_count == 0, "must be 0: l_ref_count=%d, ref_count=%d", l_ref_count, ref_count());
  75 
  76   Atomic::store(&_header, markWord::zero());
  77 
  78   clear_using_JT();
  79 }
  80 
  81 inline void ObjectMonitor::clear_using_JT() {
  82   // Unlike other *_using_JT() functions, we cannot assert
  83   // AsyncDeflateIdleMonitors or Thread::current()->is_Java_thread()
  84   // because clear() calls this function for the rest of its checks.
  85 
  86   if (AsyncDeflateIdleMonitors) {
  87     // Async deflation protocol uses the header, owner and ref_count
  88     // fields. While the ObjectMonitor being deflated is on the global free
  89     // list, we leave those three fields alone; owner == DEFLATER_MARKER
  90     // and ref_count < 0 will force any racing threads to retry. The
  91     // header field is used by install_displaced_markword_in_object()
  92     // to restore the object's header so we cannot check its value here.

  93     guarantee(_owner == NULL || _owner == DEFLATER_MARKER,
  94               "must be NULL or DEFLATER_MARKER: owner=" INTPTR_FORMAT,
  95               p2i(_owner));
  96     jint l_ref_count = ref_count();
  97     guarantee(l_ref_count <= 0, "must be <= 0: l_ref_count=%d, ref_count=%d", l_ref_count, ref_count());
  98   }
  99   assert(_contentions == 0, "must be 0: contentions=%d", _contentions);
 100   assert(_waiters == 0, "must be 0: waiters=%d", _waiters);
 101   assert(_recursions == 0, "must be 0: recursions=" INTX_FORMAT, _recursions);
 102   assert(_object != NULL, "must be non-NULL");
 103 
 104   set_allocation_state(Free);
 105   _object = NULL;
 106 }
 107 
 108 inline void* ObjectMonitor::object() const {
 109   return _object;
 110 }
 111 
 112 inline void* ObjectMonitor::object_addr() {


< prev index next >