mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 03:54:33 +02:00
8034079: G1: Refactor the HeapRegionSet hierarchy
Reviewed-by: tschatzl, pliden
This commit is contained in:
parent
1d21f8975b
commit
c88e3def4d
17 changed files with 447 additions and 923 deletions
|
@ -194,17 +194,19 @@ class G1PrepareCompactClosure: public HeapRegionClosure {
|
|||
G1CollectedHeap* _g1h;
|
||||
ModRefBarrierSet* _mrbs;
|
||||
CompactPoint _cp;
|
||||
HumongousRegionSet _humongous_proxy_set;
|
||||
HeapRegionSetCount _humongous_regions_removed;
|
||||
|
||||
void free_humongous_region(HeapRegion* hr) {
|
||||
HeapWord* end = hr->end();
|
||||
size_t dummy_pre_used;
|
||||
FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep");
|
||||
|
||||
assert(hr->startsHumongous(),
|
||||
"Only the start of a humongous region should be freed.");
|
||||
_g1h->free_humongous_region(hr, &dummy_pre_used, &dummy_free_list,
|
||||
&_humongous_proxy_set, false /* par */);
|
||||
|
||||
hr->set_containing_set(NULL);
|
||||
_humongous_regions_removed.increment(1u, hr->capacity());
|
||||
|
||||
_g1h->free_humongous_region(hr, &dummy_free_list, false /* par */);
|
||||
hr->prepare_for_compaction(&_cp);
|
||||
// Also clear the part of the card table that will be unused after
|
||||
// compaction.
|
||||
|
@ -217,16 +219,13 @@ public:
|
|||
: _g1h(G1CollectedHeap::heap()),
|
||||
_mrbs(_g1h->g1_barrier_set()),
|
||||
_cp(NULL, cs, cs->initialize_threshold()),
|
||||
_humongous_proxy_set("G1MarkSweep Humongous Proxy Set") { }
|
||||
_humongous_regions_removed() { }
|
||||
|
||||
void update_sets() {
|
||||
// We'll recalculate total used bytes and recreate the free list
|
||||
// at the end of the GC, so no point in updating those values here.
|
||||
_g1h->update_sets_after_freeing_regions(0, /* pre_used */
|
||||
NULL, /* free_list */
|
||||
NULL, /* old_proxy_set */
|
||||
&_humongous_proxy_set,
|
||||
false /* par */);
|
||||
HeapRegionSetCount empty_set;
|
||||
_g1h->remove_from_old_sets(empty_set, _humongous_regions_removed);
|
||||
}
|
||||
|
||||
bool doHeapRegion(HeapRegion* hr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue