diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index eca8f551e6d90..f60e2ea70ed9d 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -2326,12 +2326,11 @@ void G1CollectedHeap::collection_set_iterate_increment_from(HeapRegionClosure *c _collection_set.iterate_incremental_part_from(cl, hr_claimer, worker_id); } -void G1CollectedHeap::par_iterate_regions_array_part_from(HeapRegionClosure* cl, - HeapRegionClaimer* hr_claimer, - const uint* regions, - size_t offset, - size_t length, - uint worker_id) const { +void G1CollectedHeap::par_iterate_regions_array(HeapRegionClosure* cl, + HeapRegionClaimer* hr_claimer, + const uint regions[], + size_t length, + uint worker_id) const { assert_at_safepoint(); if (length == 0) { return; @@ -2342,7 +2341,7 @@ void G1CollectedHeap::par_iterate_regions_array_part_from(HeapRegionClosure* cl, size_t cur_pos = start_pos; do { - uint region_idx = regions[cur_pos + offset]; + uint region_idx = regions[cur_pos]; if (hr_claimer == NULL || hr_claimer->claim_region(region_idx)) { HeapRegion* r = region_at(region_idx); bool result = cl->do_heap_region(r); diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index c3dfb31d013f3..6422672a8632c 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -1155,15 +1155,14 @@ class G1CollectedHeap : public CollectedHeap { collection_set_iterate_increment_from(blk, NULL, worker_id); } void collection_set_iterate_increment_from(HeapRegionClosure *blk, HeapRegionClaimer* hr_claimer, uint worker_id); - // Iterate part of an array of region indexes given by offset and length, applying + // Iterate over the array of region indexes, uint regions[length], applying // the given HeapRegionClosure on each region. The worker_id will determine where - // in the part to start the iteration to allow for more efficient parallel iteration. - void par_iterate_regions_array_part_from(HeapRegionClosure* cl, - HeapRegionClaimer* hr_claimer, - const uint* regions, - size_t offset, - size_t length, - uint worker_id) const; + // to start the iteration to allow for more efficient parallel iteration. + void par_iterate_regions_array(HeapRegionClosure* cl, + HeapRegionClaimer* hr_claimer, + const uint regions[], + size_t length, + uint worker_id) const; // Returns the HeapRegion that contains addr. addr must not be NULL. template diff --git a/src/hotspot/share/gc/g1/g1CollectionSet.cpp b/src/hotspot/share/gc/g1/g1CollectionSet.cpp index 62b3ad983a0d5..9c385a0de441c 100644 --- a/src/hotspot/share/gc/g1/g1CollectionSet.cpp +++ b/src/hotspot/share/gc/g1/g1CollectionSet.cpp @@ -232,7 +232,11 @@ void G1CollectionSet::iterate_part_from(HeapRegionClosure* cl, size_t offset, size_t length, uint worker_id) const { - _g1h->par_iterate_regions_array_part_from(cl, hr_claimer, _collection_set_regions, offset, length, worker_id); + _g1h->par_iterate_regions_array(cl, + hr_claimer, + &_collection_set_regions[offset], + length, + worker_id); } void G1CollectionSet::update_young_region_prediction(HeapRegion* hr, diff --git a/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp b/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp index a6b7a16ce2816..8560d02616f67 100644 --- a/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp +++ b/src/hotspot/share/gc/g1/g1EvacFailureRegions.cpp @@ -49,12 +49,11 @@ void G1EvacFailureRegions::initialize(uint max_regions) { void G1EvacFailureRegions::par_iterate(HeapRegionClosure* closure, HeapRegionClaimer* _hrclaimer, uint worker_id) { - G1CollectedHeap::heap()->par_iterate_regions_array_part_from(closure, - _hrclaimer, - _evac_failure_regions, - 0, - Atomic::load(&_evac_failure_regions_cur_length), - worker_id); + G1CollectedHeap::heap()->par_iterate_regions_array(closure, + _hrclaimer, + _evac_failure_regions, + Atomic::load(&_evac_failure_regions_cur_length), + worker_id); } void G1EvacFailureRegions::reset() {