< prev index next >

src/hotspot/share/gc/shared/cardTableRS.cpp

Print this page
rev 58025 : imported patch 8238854-remove-superfluous-alloc-checks


 562 void CardTableRS::verify() {
 563   // At present, we only know how to verify the card table RS for
 564   // generational heaps.
 565   VerifyCTGenClosure blk(this);
 566   GenCollectedHeap::heap()->generation_iterate(&blk, false);
 567   CardTable::verify();
 568 }
 569 
 570 CardTableRS::CardTableRS(MemRegion whole_heap, bool scanned_concurrently) :
 571   CardTable(whole_heap, scanned_concurrently),
 572   _cur_youngergen_card_val(youngergenP1_card),
 573   // LNC functionality
 574   _lowest_non_clean(NULL),
 575   _lowest_non_clean_chunk_size(NULL),
 576   _lowest_non_clean_base_chunk_index(NULL),
 577   _last_LNC_resizing_collection(NULL)
 578 {
 579   // max_gens is really GenCollectedHeap::heap()->gen_policy()->number_of_generations()
 580   // (which is always 2, young & old), but GenCollectedHeap has not been initialized yet.
 581   uint max_gens = 2;
 582   _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(CardValue, max_gens + 1,
 583                          mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL);
 584   if (_last_cur_val_in_gen == NULL) {
 585     vm_exit_during_initialization("Could not create last_cur_val_in_gen array.");
 586   }
 587   for (uint i = 0; i < max_gens + 1; i++) {
 588     _last_cur_val_in_gen[i] = clean_card_val();
 589   }
 590 }
 591 
 592 CardTableRS::~CardTableRS() {
 593   FREE_C_HEAP_ARRAY(CardValue, _last_cur_val_in_gen);
 594   FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean);
 595   FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size);
 596   FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
 597   FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
 598 }
 599 
 600 void CardTableRS::initialize() {
 601   CardTable::initialize();
 602   _lowest_non_clean =
 603     NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
 604   _lowest_non_clean_chunk_size =
 605     NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
 606   _lowest_non_clean_base_chunk_index =




 562 void CardTableRS::verify() {
 563   // At present, we only know how to verify the card table RS for
 564   // generational heaps.
 565   VerifyCTGenClosure blk(this);
 566   GenCollectedHeap::heap()->generation_iterate(&blk, false);
 567   CardTable::verify();
 568 }
 569 
 570 CardTableRS::CardTableRS(MemRegion whole_heap, bool scanned_concurrently) :
 571   CardTable(whole_heap, scanned_concurrently),
 572   _cur_youngergen_card_val(youngergenP1_card),
 573   // LNC functionality
 574   _lowest_non_clean(NULL),
 575   _lowest_non_clean_chunk_size(NULL),
 576   _lowest_non_clean_base_chunk_index(NULL),
 577   _last_LNC_resizing_collection(NULL)
 578 {
 579   // max_gens is really GenCollectedHeap::heap()->gen_policy()->number_of_generations()
 580   // (which is always 2, young & old), but GenCollectedHeap has not been initialized yet.
 581   uint max_gens = 2;
 582   _last_cur_val_in_gen = NEW_C_HEAP_ARRAY(CardValue, max_gens + 1, mtGC);




 583   for (uint i = 0; i < max_gens + 1; i++) {
 584     _last_cur_val_in_gen[i] = clean_card_val();
 585   }
 586 }
 587 
 588 CardTableRS::~CardTableRS() {
 589   FREE_C_HEAP_ARRAY(CardValue, _last_cur_val_in_gen);
 590   FREE_C_HEAP_ARRAY(CardArr, _lowest_non_clean);
 591   FREE_C_HEAP_ARRAY(size_t, _lowest_non_clean_chunk_size);
 592   FREE_C_HEAP_ARRAY(uintptr_t, _lowest_non_clean_base_chunk_index);
 593   FREE_C_HEAP_ARRAY(int, _last_LNC_resizing_collection);
 594 }
 595 
 596 void CardTableRS::initialize() {
 597   CardTable::initialize();
 598   _lowest_non_clean =
 599     NEW_C_HEAP_ARRAY(CardArr, _max_covered_regions, mtGC);
 600   _lowest_non_clean_chunk_size =
 601     NEW_C_HEAP_ARRAY(size_t, _max_covered_regions, mtGC);
 602   _lowest_non_clean_base_chunk_index =


< prev index next >