Skip to content

Commit 7e73c43

Browse files
committed
8345217: Parallel: Refactor PSParallelCompact::next_src_region
Reviewed-by: tschatzl, sjohanss, zgu
1 parent 7d3a404 commit 7e73c43

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/hotspot/share/gc/parallel/psParallelCompact.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,13 +2137,9 @@ size_t PSParallelCompact::next_src_region(MoveAndUpdateClosure& closure,
21372137
}
21382138

21392139
if (src_region_ptr < top_region_ptr) {
2140-
// The next source region is in the current space. Update src_region_idx
2141-
// and the source address to match src_region_ptr.
2140+
// Found the first non-empty region in the same space.
21422141
src_region_idx = sd.region(src_region_ptr);
2143-
HeapWord* const src_region_addr = sd.region_to_addr(src_region_idx);
2144-
if (src_region_addr > closure.source()) {
2145-
closure.set_source(src_region_addr);
2146-
}
2142+
closure.set_source(sd.region_to_addr(src_region_idx));
21472143
return src_region_idx;
21482144
}
21492145

@@ -2167,13 +2163,10 @@ size_t PSParallelCompact::next_src_region(MoveAndUpdateClosure& closure,
21672163
RegionData* cur = sd.region(cur_region);
21682164
if (cur->live_obj_size() > 0) {
21692165
HeapWord* region_start_addr = sd.region_to_addr(cur_region);
2170-
HeapWord* region_end_addr = region_start_addr + ParallelCompactData::RegionSize;
2171-
HeapWord* first_live_word = mark_bitmap()->find_obj_beg(region_start_addr, region_end_addr);
2172-
assert(first_live_word < region_end_addr, "inv");
21732166

21742167
src_space_id = SpaceId(space_id);
21752168
src_space_top = top;
2176-
closure.set_source(first_live_word);
2169+
closure.set_source(region_start_addr);
21772170
return cur_region;
21782171
}
21792172
}

0 commit comments

Comments
 (0)