hotspot/src/share/vm/runtime/synchronizer.cpp
changeset 46342 c871e0f8b02a
parent 46271 979ebd346ecf
child 46474 c872a196b75f
equal deleted inserted replaced
46341:4c676683bdb9 46342:c871e0f8b02a
  1877   }
  1877   }
  1878 }
  1878 }
  1879 
  1879 
  1880 #ifndef PRODUCT
  1880 #ifndef PRODUCT
  1881 
  1881 
  1882 // Verify all monitors in the monitor cache, the verification is weak.
       
  1883 void ObjectSynchronizer::verify() {
       
  1884   PaddedEnd<ObjectMonitor> * block =
       
  1885     (PaddedEnd<ObjectMonitor> *)OrderAccess::load_ptr_acquire(&gBlockList);
       
  1886   while (block != NULL) {
       
  1887     assert(block->object() == CHAINMARKER, "must be a block header");
       
  1888     for (int i = 1; i < _BLOCKSIZE; i++) {
       
  1889       ObjectMonitor* mid = (ObjectMonitor *)(block + i);
       
  1890       oop object = (oop)mid->object();
       
  1891       if (object != NULL) {
       
  1892         mid->verify();
       
  1893       }
       
  1894     }
       
  1895     block = (PaddedEnd<ObjectMonitor> *)block->FreeNext;
       
  1896   }
       
  1897 }
       
  1898 
       
  1899 // Check if monitor belongs to the monitor cache
  1882 // Check if monitor belongs to the monitor cache
  1900 // The list is grow-only so it's *relatively* safe to traverse
  1883 // The list is grow-only so it's *relatively* safe to traverse
  1901 // the list of extant blocks without taking a lock.
  1884 // the list of extant blocks without taking a lock.
  1902 
  1885 
  1903 int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) {
  1886 int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) {