< prev index next >

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

Print this page
rev 9773 : imported patch 8145672-remove-dependency-of-g1fromcardcache-to-heapregionremset
rev 9774 : imported patch 8145672-jmasa-comments
rev 9775 : imported patch 8145774-move-scrubbing-method-around


5394           log_info(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u",
5395                                hr->is_old(), cset_state.value(), i);
5396           _failures = true;
5397           return true;
5398         }
5399       }
5400     }
5401     return false;
5402   }
5403 
5404   bool failures() const { return _failures; }
5405 };
5406 
5407 bool G1CollectedHeap::check_cset_fast_test() {
5408   G1CheckCSetFastTableClosure cl;
5409   _hrm.iterate(&cl);
5410   return !cl.failures();
5411 }
5412 #endif // PRODUCT
5413 



























5414 void G1CollectedHeap::cleanUpCardTable() {
5415   G1SATBCardTableModRefBS* ct_bs = g1_barrier_set();
5416   double start = os::elapsedTime();
5417 
5418   {
5419     // Iterate over the dirty cards region list.
5420     G1ParCleanupCTTask cleanup_task(ct_bs, this);
5421 
5422     workers()->run_task(&cleanup_task);
5423 #ifndef PRODUCT
5424     if (G1VerifyCTCleanup || VerifyAfterGC) {
5425       G1VerifyCardTableCleanup cleanup_verifier(this, ct_bs);
5426       heap_region_iterate(&cleanup_verifier);
5427     }
5428 #endif
5429   }
5430 
5431   double elapsed = os::elapsedTime() - start;
5432   g1_policy()->phase_times()->record_clear_ct_time(elapsed * 1000.0);
5433 }




5394           log_info(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u",
5395                                hr->is_old(), cset_state.value(), i);
5396           _failures = true;
5397           return true;
5398         }
5399       }
5400     }
5401     return false;
5402   }
5403 
5404   bool failures() const { return _failures; }
5405 };
5406 
5407 bool G1CollectedHeap::check_cset_fast_test() {
5408   G1CheckCSetFastTableClosure cl;
5409   _hrm.iterate(&cl);
5410   return !cl.failures();
5411 }
5412 #endif // PRODUCT
5413 
5414 class G1ParScrubRemSetTask: public AbstractGangTask {
5415 protected:
5416   G1RemSet* _g1rs;
5417   BitMap* _region_bm;
5418   BitMap* _card_bm;
5419   HeapRegionClaimer _hrclaimer;
5420 
5421 public:
5422   G1ParScrubRemSetTask(G1RemSet* g1_rs, BitMap* region_bm, BitMap* card_bm, uint num_workers) :
5423     AbstractGangTask("G1 ScrubRS"),
5424     _g1rs(g1_rs),
5425     _region_bm(region_bm),
5426     _card_bm(card_bm),
5427     _hrclaimer(num_workers) {
5428   }
5429 
5430   void work(uint worker_id) {
5431     _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer);
5432   }
5433 };
5434 
5435 void G1CollectedHeap::scrub_rem_set(BitMap* region_bm, BitMap* card_bm) {
5436   uint num_workers = workers()->active_workers();
5437   G1ParScrubRemSetTask g1_par_scrub_rs_task(g1_rem_set(), region_bm, card_bm, num_workers);
5438   workers()->run_task(&g1_par_scrub_rs_task);
5439 }
5440 
5441 void G1CollectedHeap::cleanUpCardTable() {
5442   G1SATBCardTableModRefBS* ct_bs = g1_barrier_set();
5443   double start = os::elapsedTime();
5444 
5445   {
5446     // Iterate over the dirty cards region list.
5447     G1ParCleanupCTTask cleanup_task(ct_bs, this);
5448 
5449     workers()->run_task(&cleanup_task);
5450 #ifndef PRODUCT
5451     if (G1VerifyCTCleanup || VerifyAfterGC) {
5452       G1VerifyCardTableCleanup cleanup_verifier(this, ct_bs);
5453       heap_region_iterate(&cleanup_verifier);
5454     }
5455 #endif
5456   }
5457 
5458   double elapsed = os::elapsedTime() - start;
5459   g1_policy()->phase_times()->record_clear_ct_time(elapsed * 1000.0);
5460 }


< prev index next >