1868 (*warning_cnt_ptr)++;
1869 }
1870
1871 if ((sizeof(SharedGlobals) - offset_hcSequence) < cache_line_size) {
1872 tty->print_cr("WARNING: the SharedGlobals.hcSequence field is closer "
1873 "to the struct end than a cache line which permits false "
1874 "sharing.");
1875 (*warning_cnt_ptr)++;
1876 }
1877 }
1878 }
1879
1880 #ifndef PRODUCT
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
1900 // The list is grow-only so it's *relatively* safe to traverse
1901 // the list of extant blocks without taking a lock.
1902
1903 int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) {
1904 PaddedEnd<ObjectMonitor> * block =
1905 (PaddedEnd<ObjectMonitor> *)OrderAccess::load_ptr_acquire(&gBlockList);
1906 while (block != NULL) {
1907 assert(block->object() == CHAINMARKER, "must be a block header");
1908 if (monitor > (ObjectMonitor *)&block[0] &&
1909 monitor < (ObjectMonitor *)&block[_BLOCKSIZE]) {
1910 address mon = (address)monitor;
1911 address blk = (address)block;
1912 size_t diff = mon - blk;
1913 assert((diff % sizeof(PaddedEnd<ObjectMonitor>)) == 0, "must be aligned");
1914 return 1;
|
1868 (*warning_cnt_ptr)++;
1869 }
1870
1871 if ((sizeof(SharedGlobals) - offset_hcSequence) < cache_line_size) {
1872 tty->print_cr("WARNING: the SharedGlobals.hcSequence field is closer "
1873 "to the struct end than a cache line which permits false "
1874 "sharing.");
1875 (*warning_cnt_ptr)++;
1876 }
1877 }
1878 }
1879
1880 #ifndef PRODUCT
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 block = (PaddedEnd<ObjectMonitor> *)block->FreeNext;
1889 }
1890 }
1891
1892 // Check if monitor belongs to the monitor cache
1893 // The list is grow-only so it's *relatively* safe to traverse
1894 // the list of extant blocks without taking a lock.
1895
1896 int ObjectSynchronizer::verify_objmon_isinpool(ObjectMonitor *monitor) {
1897 PaddedEnd<ObjectMonitor> * block =
1898 (PaddedEnd<ObjectMonitor> *)OrderAccess::load_ptr_acquire(&gBlockList);
1899 while (block != NULL) {
1900 assert(block->object() == CHAINMARKER, "must be a block header");
1901 if (monitor > (ObjectMonitor *)&block[0] &&
1902 monitor < (ObjectMonitor *)&block[_BLOCKSIZE]) {
1903 address mon = (address)monitor;
1904 address blk = (address)block;
1905 size_t diff = mon - blk;
1906 assert((diff % sizeof(PaddedEnd<ObjectMonitor>)) == 0, "must be aligned");
1907 return 1;
|