Skip to content

Commit ce7a890

Browse files
author
Thomas Schatzl
committed
8379200: G1: Remove G1HeapRegion completion facility
Reviewed-by: ayang, iwalulya
1 parent 61a9c71 commit ce7a890

4 files changed

Lines changed: 1 addition & 35 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,6 @@ void G1CollectionSet::iterate(G1HeapRegionClosure* cl) const {
174174
G1HeapRegion* r = _g1h->region_at(_regions[i]);
175175
bool result = cl->do_heap_region(r);
176176
if (result) {
177-
cl->set_incomplete();
178177
return;
179178
}
180179
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,6 @@ class G1ClearBitMapTask : public WorkerTask {
817817
SuspendibleThreadSetJoiner sts_join(_suspendible);
818818
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&_cl, &_hr_claimer, worker_id);
819819
}
820-
821-
bool is_complete() {
822-
return _cl.is_complete();
823-
}
824820
};
825821

826822
void G1ConcurrentMark::clear_bitmap(WorkerThreads* workers, bool may_yield) {
@@ -835,7 +831,6 @@ void G1ConcurrentMark::clear_bitmap(WorkerThreads* workers, bool may_yield) {
835831

836832
log_debug(gc, ergo)("Running %s with %u workers for %zu work units.", cl.name(), num_workers, num_chunks);
837833
workers->run_task(&cl, num_workers);
838-
guarantee(may_yield || cl.is_complete(), "Must have completed iteration when not yielding.");
839834
}
840835

841836
void G1ConcurrentMark::cleanup_for_next_mark() {

src/hotspot/share/gc/g1/g1HeapRegion.hpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -567,41 +567,15 @@ class G1HeapRegion : public CHeapObj<mtGC> {
567567
// G1HeapRegionClosure is used for iterating over regions.
568568
// Terminates the iteration when the "do_heap_region" method returns "true".
569569
class G1HeapRegionClosure : public StackObj {
570-
friend class G1HeapRegionManager;
571-
friend class G1CollectionSet;
572-
friend class G1CollectionSetCandidates;
573-
574-
bool _is_complete;
575-
void set_incomplete() { _is_complete = false; }
576-
577570
public:
578-
G1HeapRegionClosure(): _is_complete(true) {}
579-
580571
// Typically called on each region until it returns true.
581572
virtual bool do_heap_region(G1HeapRegion* r) = 0;
582-
583-
// True after iteration if the closure was applied to all heap regions
584-
// and returned "false" in all cases.
585-
bool is_complete() { return _is_complete; }
586573
};
587574

588575
class G1HeapRegionIndexClosure : public StackObj {
589-
friend class G1HeapRegionManager;
590-
friend class G1CollectionSet;
591-
friend class G1CollectionSetCandidates;
592-
593-
bool _is_complete;
594-
void set_incomplete() { _is_complete = false; }
595-
596576
public:
597-
G1HeapRegionIndexClosure(): _is_complete(true) {}
598-
599577
// Typically called on each region until it returns true.
600578
virtual bool do_heap_region_index(uint region_index) = 0;
601-
602-
// True after iteration if the closure was applied to all heap regions
603-
// and returned "false" in all cases.
604-
bool is_complete() { return _is_complete; }
605579
};
606580

607581
#endif // SHARE_GC_G1_G1HEAPREGION_HPP

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ void G1HeapRegionManager::iterate(G1HeapRegionClosure* blk) const {
511511
guarantee(at(i) != nullptr, "Tried to access region %u that has a null G1HeapRegion*", i);
512512
bool res = blk->do_heap_region(at(i));
513513
if (res) {
514-
blk->set_incomplete();
515514
return;
516515
}
517516
}
@@ -526,7 +525,6 @@ void G1HeapRegionManager::iterate(G1HeapRegionIndexClosure* blk) const {
526525
}
527526
bool res = blk->do_heap_region_index(i);
528527
if (res) {
529-
blk->set_incomplete();
530528
return;
531529
}
532530
}

0 commit comments

Comments
 (0)