comparison src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp @ 1716:be3f9c242c9d

6948538: CMS: BOT walkers can fall into object allocation and initialization cracks Summary: GC workers now recognize an intermediate transient state of blocks which are allocated but have not yet completed initialization. blk_start() calls do not attempt to determine the size of a block in the transient state, rather waiting for the block to become initialized so that it is safe to query its size. Audited and ensured the order of initialization of object fields (klass, free bit and size) to respect block state transition protocol. Also included some new assertion checking code enabled in debug mode. Reviewed-by: chrisphi, johnc, poonam
author ysr
date Mon, 16 Aug 2010 15:58:42 -0700
parents c18cbe5936b8
children 179464550c7d
comparison
equal deleted inserted replaced
1713:7fcd5f39bd7a 1716:be3f9c242c9d
328 } 328 }
329 329
330 void PromotionInfo::print_on(outputStream* st) const { 330 void PromotionInfo::print_on(outputStream* st) const {
331 SpoolBlock* curSpool = NULL; 331 SpoolBlock* curSpool = NULL;
332 size_t i = 0; 332 size_t i = 0;
333 st->print_cr("start & end indices: [" SIZE_FORMAT ", " SIZE_FORMAT ")", 333 st->print_cr(" start & end indices: [" SIZE_FORMAT ", " SIZE_FORMAT ")",
334 _firstIndex, _nextIndex); 334 _firstIndex, _nextIndex);
335 for (curSpool = _spoolHead; curSpool != _spoolTail && curSpool != NULL; 335 for (curSpool = _spoolHead; curSpool != _spoolTail && curSpool != NULL;
336 curSpool = curSpool->nextSpoolBlock) { 336 curSpool = curSpool->nextSpoolBlock) {
337 curSpool->print_on(st); 337 curSpool->print_on(st);
338 st->print_cr(" active "); 338 st->print_cr(" active ");
348 curSpool = curSpool->nextSpoolBlock) { 348 curSpool = curSpool->nextSpoolBlock) {
349 curSpool->print_on(st); 349 curSpool->print_on(st);
350 st->print_cr(" free "); 350 st->print_cr(" free ");
351 i++; 351 i++;
352 } 352 }
353 st->print_cr(SIZE_FORMAT " header spooling blocks", i); 353 st->print_cr(" " SIZE_FORMAT " header spooling blocks", i);
354 } 354 }
355 355
356 void SpoolBlock::print_on(outputStream* st) const { 356 void SpoolBlock::print_on(outputStream* st) const {
357 st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT, 357 st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT,
358 this, (HeapWord*)displacedHdr + bufferSize, 358 this, (HeapWord*)displacedHdr + bufferSize,