hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
changeset 8296 b1c2163e4e59
parent 8076 96d498ec7ae1
child 8684 7ebbd0b3e295
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Thu Feb 03 20:49:09 2011 -0800
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Mon Feb 07 22:19:57 2011 -0800
@@ -6360,18 +6360,16 @@
 // A variant of the above (block_size_using_printezis_bits()) except
 // that we return 0 if the P-bits are not yet set.
 size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const {
-  if (_markBitMap.isMarked(addr)) {
-    assert(_markBitMap.isMarked(addr + 1), "Missing Printezis bit?");
+  if (_markBitMap.isMarked(addr + 1)) {
+    assert(_markBitMap.isMarked(addr), "P-bit can be set only for marked objects");
     HeapWord* nextOneAddr = _markBitMap.getNextMarkedWordAddress(addr + 2);
     size_t size = pointer_delta(nextOneAddr + 1, addr);
     assert(size == CompactibleFreeListSpace::adjustObjectSize(size),
            "alignment problem");
     assert(size >= 3, "Necessary for Printezis marks to work");
     return size;
-  } else {
-    assert(!_markBitMap.isMarked(addr + 1), "Bit map inconsistency?");
-    return 0;
-  }
+  }
+  return 0;
 }
 
 HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const {
@@ -9212,7 +9210,6 @@
 
 size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) {
   size_t res = _sp->block_size_no_stall(addr, _collector);
-  assert(res != 0, "Should always be able to compute a size");
   if (_sp->block_is_obj(addr)) {
     if (_live_bit_map->isMarked(addr)) {
       // It can't have been dead in a previous cycle
@@ -9221,6 +9218,7 @@
       _dead_bit_map->mark(addr);      // mark the dead object
     }
   }
+  // Could be 0, if the block size could not be computed without stalling.
   return res;
 }