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

Print this page




2612   }
2613 };
2614 
2615 void G1CollectedHeap::space_iterate(SpaceClosure* cl) {
2616   SpaceClosureRegionClosure blk(cl);
2617   heap_region_iterate(&blk);
2618 }
2619 
2620 void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
2621   _hrs.iterate(cl);
2622 }
2623 
2624 void
2625 G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl,
2626                                                  uint worker_id,
2627                                                  uint num_workers,
2628                                                  jint claim_value) const {
2629   _hrs.par_iterate(cl, worker_id, num_workers, claim_value);
2630 }
2631 





2632 class ResetClaimValuesClosure: public HeapRegionClosure {
2633 public:
2634   bool doHeapRegion(HeapRegion* r) {
2635     r->set_claim_value(HeapRegion::InitialClaimValue);
2636     return false;
2637   }
2638 };
2639 
2640 void G1CollectedHeap::reset_heap_region_claim_values() {
2641   ResetClaimValuesClosure blk;
2642   heap_region_iterate(&blk);
2643 }
2644 
2645 void G1CollectedHeap::reset_cset_heap_region_claim_values() {
2646   ResetClaimValuesClosure blk;
2647   collection_set_iterate(&blk);
2648 }
2649 
2650 #ifdef ASSERT
2651 // This checks whether all regions in the heap have the correct claim




2612   }
2613 };
2614 
2615 void G1CollectedHeap::space_iterate(SpaceClosure* cl) {
2616   SpaceClosureRegionClosure blk(cl);
2617   heap_region_iterate(&blk);
2618 }
2619 
2620 void G1CollectedHeap::heap_region_iterate(HeapRegionClosure* cl) const {
2621   _hrs.iterate(cl);
2622 }
2623 
2624 void
2625 G1CollectedHeap::heap_region_par_iterate_chunked(HeapRegionClosure* cl,
2626                                                  uint worker_id,
2627                                                  uint num_workers,
2628                                                  jint claim_value) const {
2629   _hrs.par_iterate(cl, worker_id, num_workers, claim_value);
2630 }
2631 
2632 void
2633 G1CollectedHeap::heap_region_iterate_range(HeapRegionClosure* cl, uint start, uint end) const {
2634   _hrs.iterate_range(cl, start, end);
2635 }
2636 
2637 class ResetClaimValuesClosure: public HeapRegionClosure {
2638 public:
2639   bool doHeapRegion(HeapRegion* r) {
2640     r->set_claim_value(HeapRegion::InitialClaimValue);
2641     return false;
2642   }
2643 };
2644 
2645 void G1CollectedHeap::reset_heap_region_claim_values() {
2646   ResetClaimValuesClosure blk;
2647   heap_region_iterate(&blk);
2648 }
2649 
2650 void G1CollectedHeap::reset_cset_heap_region_claim_values() {
2651   ResetClaimValuesClosure blk;
2652   collection_set_iterate(&blk);
2653 }
2654 
2655 #ifdef ASSERT
2656 // This checks whether all regions in the heap have the correct claim