src/hotspot/share/gc/g1/heapRegionManager.cpp
changeset 47885 5caa1d5f74c1
parent 47789 a77a7d3bc4f6
child 48889 216c2aabbf1f
equal deleted inserted replaced
47884:3cfab71d6c81 47885:5caa1d5f74c1
   325   allocate_free_regions_starting_at(start_index, (last_index - start_index) + 1);
   325   allocate_free_regions_starting_at(start_index, (last_index - start_index) + 1);
   326   *commit_count = commits;
   326   *commit_count = commits;
   327   return true;
   327   return true;
   328 }
   328 }
   329 
   329 
   330 void HeapRegionManager::par_iterate(HeapRegionClosure* blk, uint worker_id, HeapRegionClaimer* hrclaimer) const {
   330 void HeapRegionManager::par_iterate(HeapRegionClosure* blk, HeapRegionClaimer* hrclaimer, const uint start_index) const {
   331   const uint start_index = hrclaimer->start_region_for_worker(worker_id);
       
   332 
       
   333   // Every worker will actually look at all regions, skipping over regions that
   331   // Every worker will actually look at all regions, skipping over regions that
   334   // are currently not committed.
   332   // are currently not committed.
   335   // This also (potentially) iterates over regions newly allocated during GC. This
   333   // This also (potentially) iterates over regions newly allocated during GC. This
   336   // is no problem except for some extra work.
   334   // is no problem except for some extra work.
   337   const uint n_regions = hrclaimer->n_regions();
   335   const uint n_regions = hrclaimer->n_regions();
   491   if (_claims != NULL) {
   489   if (_claims != NULL) {
   492     FREE_C_HEAP_ARRAY(uint, _claims);
   490     FREE_C_HEAP_ARRAY(uint, _claims);
   493   }
   491   }
   494 }
   492 }
   495 
   493 
   496 uint HeapRegionClaimer::start_region_for_worker(uint worker_id) const {
   494 uint HeapRegionClaimer::offset_for_worker(uint worker_id) const {
   497   assert(worker_id < _n_workers, "Invalid worker_id.");
   495   assert(worker_id < _n_workers, "Invalid worker_id.");
   498   return _n_regions * worker_id / _n_workers;
   496   return _n_regions * worker_id / _n_workers;
   499 }
   497 }
   500 
   498 
   501 bool HeapRegionClaimer::is_region_claimed(uint region_index) const {
   499 bool HeapRegionClaimer::is_region_claimed(uint region_index) const {