< prev index next >

src/share/vm/gc/g1/g1BlockOffsetTable.cpp

Print this page
rev 12504 : 8173764: G1 BOT wrongly assumes that objects must always begin at the start of G1BlockOffsetTablePart
Reviewed-by:
rev 12505 : imported patch 8173764-rev-tschatzl
rev 12506 : [mq]: 8173764-rev-kbarret


 349     } else {
 350       // Because we refine the BOT based on which cards are dirty there is not much we can verify here.
 351       // We need to make sure that we are going backwards and that we don't pass the start of the
 352       // corresponding heap region. But that is about all we can verify.
 353       size_t backskip = BOTConstants::entry_to_cards_back(entry);
 354       guarantee(backskip >= 1, "Must be going back at least one card.");
 355 
 356       size_t max_backskip = current_card - start_card;
 357       guarantee(backskip <= max_backskip,
 358                 "Going backwards beyond the start_card. start_card: " SIZE_FORMAT " current_card: " SIZE_FORMAT " backskip: " SIZE_FORMAT,
 359                 start_card, current_card, backskip);
 360 
 361       HeapWord* backskip_address = _bot->address_for_index(current_card - backskip);
 362       guarantee(backskip_address >= _space->bottom(),
 363                 "Going backwards beyond bottom of the region: bottom: " PTR_FORMAT ", backskip_address: " PTR_FORMAT,
 364                 p2i(_space->bottom()), p2i(backskip_address));
 365     }
 366   }
 367 }
 368 
 369 #ifndef PRODUCT
 370 void G1BlockOffsetTablePart::set_object_can_span(bool can_span) {
 371   _object_can_span = can_span;
 372 }

 373 

 374 void
 375 G1BlockOffsetTablePart::print_on(outputStream* out) {
 376   size_t from_index = _bot->index_for(_space->bottom());
 377   size_t to_index = _bot->index_for(_space->end());
 378   out->print_cr(">> BOT for area [" PTR_FORMAT "," PTR_FORMAT ") "
 379                 "cards [" SIZE_FORMAT "," SIZE_FORMAT ")",
 380                 p2i(_space->bottom()), p2i(_space->end()), from_index, to_index);
 381   for (size_t i = from_index; i < to_index; ++i) {
 382     out->print_cr("  entry " SIZE_FORMAT_W(8) " | " PTR_FORMAT " : %3u",
 383                   i, p2i(_bot->address_for_index(i)),
 384                   (uint) _bot->offset_array(i));
 385   }
 386   out->print_cr("  next offset threshold: " PTR_FORMAT, p2i(_next_offset_threshold));
 387   out->print_cr("  next offset index:     " SIZE_FORMAT, _next_offset_index);
 388 }
 389 #endif // !PRODUCT
 390 
 391 HeapWord* G1BlockOffsetTablePart::initialize_threshold_raw() {
 392   assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array),
 393          "just checking");




 349     } else {
 350       // Because we refine the BOT based on which cards are dirty there is not much we can verify here.
 351       // We need to make sure that we are going backwards and that we don't pass the start of the
 352       // corresponding heap region. But that is about all we can verify.
 353       size_t backskip = BOTConstants::entry_to_cards_back(entry);
 354       guarantee(backskip >= 1, "Must be going back at least one card.");
 355 
 356       size_t max_backskip = current_card - start_card;
 357       guarantee(backskip <= max_backskip,
 358                 "Going backwards beyond the start_card. start_card: " SIZE_FORMAT " current_card: " SIZE_FORMAT " backskip: " SIZE_FORMAT,
 359                 start_card, current_card, backskip);
 360 
 361       HeapWord* backskip_address = _bot->address_for_index(current_card - backskip);
 362       guarantee(backskip_address >= _space->bottom(),
 363                 "Going backwards beyond bottom of the region: bottom: " PTR_FORMAT ", backskip_address: " PTR_FORMAT,
 364                 p2i(_space->bottom()), p2i(backskip_address));
 365     }
 366   }
 367 }
 368 
 369 #ifdef ASSERT
 370 void G1BlockOffsetTablePart::set_object_can_span(bool can_span) {
 371   _object_can_span = can_span;
 372 }
 373 #endif
 374 
 375 #ifndef PRODUCT
 376 void
 377 G1BlockOffsetTablePart::print_on(outputStream* out) {
 378   size_t from_index = _bot->index_for(_space->bottom());
 379   size_t to_index = _bot->index_for(_space->end());
 380   out->print_cr(">> BOT for area [" PTR_FORMAT "," PTR_FORMAT ") "
 381                 "cards [" SIZE_FORMAT "," SIZE_FORMAT ")",
 382                 p2i(_space->bottom()), p2i(_space->end()), from_index, to_index);
 383   for (size_t i = from_index; i < to_index; ++i) {
 384     out->print_cr("  entry " SIZE_FORMAT_W(8) " | " PTR_FORMAT " : %3u",
 385                   i, p2i(_bot->address_for_index(i)),
 386                   (uint) _bot->offset_array(i));
 387   }
 388   out->print_cr("  next offset threshold: " PTR_FORMAT, p2i(_next_offset_threshold));
 389   out->print_cr("  next offset index:     " SIZE_FORMAT, _next_offset_index);
 390 }
 391 #endif // !PRODUCT
 392 
 393 HeapWord* G1BlockOffsetTablePart::initialize_threshold_raw() {
 394   assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array),
 395          "just checking");


< prev index next >