Skip to content

Commit 267ce91

Browse files
author
Thomas Schatzl
committed
8372149: G1: Remove unnecessary num_added_to_group from G1CollectionSetCandidates::set_candidates_from_marking()
Reviewed-by: iwalulya, ayang
1 parent a890185 commit 267ce91

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/hotspot/share/gc/g1/g1CollectionSetCandidates.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ void G1CollectionSetCandidates::set_candidates_from_marking(G1HeapRegion** candi
267267
// the same MixedGC.
268268
uint group_limit = p->calc_min_old_cset_length(num_candidates);
269269

270-
uint num_added_to_group = 0;
271-
272270
G1CSetCandidateGroup::reset_next_group_id();
273271
G1CSetCandidateGroup* current = nullptr;
274272

@@ -279,18 +277,16 @@ void G1CollectionSetCandidates::set_candidates_from_marking(G1HeapRegion** candi
279277
assert(!contains(r), "must not contain region %u", r->hrm_index());
280278
_contains_map[r->hrm_index()] = CandidateOrigin::Marking;
281279

282-
if (num_added_to_group == group_limit) {
280+
if (current->length() == group_limit) {
283281
if (group_limit != G1OldCSetGroupSize) {
284282
group_limit = G1OldCSetGroupSize;
285283
}
286284

287285
_from_marking_groups.append(current);
288286

289287
current = new G1CSetCandidateGroup();
290-
num_added_to_group = 0;
291288
}
292289
current->add(r);
293-
num_added_to_group++;
294290
}
295291

296292
_from_marking_groups.append(current);

0 commit comments

Comments
 (0)