mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 01:43:13 +00:00
8379200: G1: Remove G1HeapRegion completion facility
Reviewed-by: ayang, iwalulya
This commit is contained in:
parent
61a9c71983
commit
ce7a890fb4
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -174,7 +174,6 @@ void G1CollectionSet::iterate(G1HeapRegionClosure* cl) const {
|
||||
G1HeapRegion* r = _g1h->region_at(_regions[i]);
|
||||
bool result = cl->do_heap_region(r);
|
||||
if (result) {
|
||||
cl->set_incomplete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -817,10 +817,6 @@ public:
|
||||
SuspendibleThreadSetJoiner sts_join(_suspendible);
|
||||
G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&_cl, &_hr_claimer, worker_id);
|
||||
}
|
||||
|
||||
bool is_complete() {
|
||||
return _cl.is_complete();
|
||||
}
|
||||
};
|
||||
|
||||
void G1ConcurrentMark::clear_bitmap(WorkerThreads* workers, bool may_yield) {
|
||||
@ -835,7 +831,6 @@ void G1ConcurrentMark::clear_bitmap(WorkerThreads* workers, bool may_yield) {
|
||||
|
||||
log_debug(gc, ergo)("Running %s with %u workers for %zu work units.", cl.name(), num_workers, num_chunks);
|
||||
workers->run_task(&cl, num_workers);
|
||||
guarantee(may_yield || cl.is_complete(), "Must have completed iteration when not yielding.");
|
||||
}
|
||||
|
||||
void G1ConcurrentMark::cleanup_for_next_mark() {
|
||||
|
||||
@ -567,41 +567,15 @@ public:
|
||||
// G1HeapRegionClosure is used for iterating over regions.
|
||||
// Terminates the iteration when the "do_heap_region" method returns "true".
|
||||
class G1HeapRegionClosure : public StackObj {
|
||||
friend class G1HeapRegionManager;
|
||||
friend class G1CollectionSet;
|
||||
friend class G1CollectionSetCandidates;
|
||||
|
||||
bool _is_complete;
|
||||
void set_incomplete() { _is_complete = false; }
|
||||
|
||||
public:
|
||||
G1HeapRegionClosure(): _is_complete(true) {}
|
||||
|
||||
// Typically called on each region until it returns true.
|
||||
virtual bool do_heap_region(G1HeapRegion* r) = 0;
|
||||
|
||||
// True after iteration if the closure was applied to all heap regions
|
||||
// and returned "false" in all cases.
|
||||
bool is_complete() { return _is_complete; }
|
||||
};
|
||||
|
||||
class G1HeapRegionIndexClosure : public StackObj {
|
||||
friend class G1HeapRegionManager;
|
||||
friend class G1CollectionSet;
|
||||
friend class G1CollectionSetCandidates;
|
||||
|
||||
bool _is_complete;
|
||||
void set_incomplete() { _is_complete = false; }
|
||||
|
||||
public:
|
||||
G1HeapRegionIndexClosure(): _is_complete(true) {}
|
||||
|
||||
// Typically called on each region until it returns true.
|
||||
virtual bool do_heap_region_index(uint region_index) = 0;
|
||||
|
||||
// True after iteration if the closure was applied to all heap regions
|
||||
// and returned "false" in all cases.
|
||||
bool is_complete() { return _is_complete; }
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_G1_G1HEAPREGION_HPP
|
||||
|
||||
@ -511,7 +511,6 @@ void G1HeapRegionManager::iterate(G1HeapRegionClosure* blk) const {
|
||||
guarantee(at(i) != nullptr, "Tried to access region %u that has a null G1HeapRegion*", i);
|
||||
bool res = blk->do_heap_region(at(i));
|
||||
if (res) {
|
||||
blk->set_incomplete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -526,7 +525,6 @@ void G1HeapRegionManager::iterate(G1HeapRegionIndexClosure* blk) const {
|
||||
}
|
||||
bool res = blk->do_heap_region_index(i);
|
||||
if (res) {
|
||||
blk->set_incomplete();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user