6358 } |
6358 } |
6359 |
6359 |
6360 // A variant of the above (block_size_using_printezis_bits()) except |
6360 // A variant of the above (block_size_using_printezis_bits()) except |
6361 // that we return 0 if the P-bits are not yet set. |
6361 // that we return 0 if the P-bits are not yet set. |
6362 size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const { |
6362 size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const { |
6363 if (_markBitMap.isMarked(addr)) { |
6363 if (_markBitMap.isMarked(addr + 1)) { |
6364 assert(_markBitMap.isMarked(addr + 1), "Missing Printezis bit?"); |
6364 assert(_markBitMap.isMarked(addr), "P-bit can be set only for marked objects"); |
6365 HeapWord* nextOneAddr = _markBitMap.getNextMarkedWordAddress(addr + 2); |
6365 HeapWord* nextOneAddr = _markBitMap.getNextMarkedWordAddress(addr + 2); |
6366 size_t size = pointer_delta(nextOneAddr + 1, addr); |
6366 size_t size = pointer_delta(nextOneAddr + 1, addr); |
6367 assert(size == CompactibleFreeListSpace::adjustObjectSize(size), |
6367 assert(size == CompactibleFreeListSpace::adjustObjectSize(size), |
6368 "alignment problem"); |
6368 "alignment problem"); |
6369 assert(size >= 3, "Necessary for Printezis marks to work"); |
6369 assert(size >= 3, "Necessary for Printezis marks to work"); |
6370 return size; |
6370 return size; |
6371 } else { |
6371 } |
6372 assert(!_markBitMap.isMarked(addr + 1), "Bit map inconsistency?"); |
6372 return 0; |
6373 return 0; |
|
6374 } |
|
6375 } |
6373 } |
6376 |
6374 |
6377 HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const { |
6375 HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const { |
6378 size_t sz = 0; |
6376 size_t sz = 0; |
6379 oop p = (oop)addr; |
6377 oop p = (oop)addr; |
9210 return res; |
9208 return res; |
9211 } |
9209 } |
9212 |
9210 |
9213 size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) { |
9211 size_t MarkDeadObjectsClosure::do_blk(HeapWord* addr) { |
9214 size_t res = _sp->block_size_no_stall(addr, _collector); |
9212 size_t res = _sp->block_size_no_stall(addr, _collector); |
9215 assert(res != 0, "Should always be able to compute a size"); |
|
9216 if (_sp->block_is_obj(addr)) { |
9213 if (_sp->block_is_obj(addr)) { |
9217 if (_live_bit_map->isMarked(addr)) { |
9214 if (_live_bit_map->isMarked(addr)) { |
9218 // It can't have been dead in a previous cycle |
9215 // It can't have been dead in a previous cycle |
9219 guarantee(!_dead_bit_map->isMarked(addr), "No resurrection!"); |
9216 guarantee(!_dead_bit_map->isMarked(addr), "No resurrection!"); |
9220 } else { |
9217 } else { |
9221 _dead_bit_map->mark(addr); // mark the dead object |
9218 _dead_bit_map->mark(addr); // mark the dead object |
9222 } |
9219 } |
9223 } |
9220 } |
|
9221 // Could be 0, if the block size could not be computed without stalling. |
9224 return res; |
9222 return res; |
9225 } |
9223 } |
9226 |
9224 |
9227 TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(CMSCollector::CollectorState phase): TraceMemoryManagerStats() { |
9225 TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(CMSCollector::CollectorState phase): TraceMemoryManagerStats() { |
9228 |
9226 |