mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 16:44:36 +02:00
8048112: G1 Full GC needs to support the case when the very first region is not available
Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
This commit is contained in:
parent
ce1a131e47
commit
bc56e061ec
7 changed files with 44 additions and 45 deletions
|
@ -381,18 +381,7 @@ HeapRegion::HeapRegion(uint hrs_index,
|
|||
}
|
||||
|
||||
CompactibleSpace* HeapRegion::next_compaction_space() const {
|
||||
// We're not using an iterator given that it will wrap around when
|
||||
// it reaches the last region and this is not what we want here.
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
uint index = hrs_index() + 1;
|
||||
while (index < g1h->n_regions()) {
|
||||
HeapRegion* hr = g1h->region_at(index);
|
||||
if (!hr->isHumongous()) {
|
||||
return hr;
|
||||
}
|
||||
index += 1;
|
||||
}
|
||||
return NULL;
|
||||
return G1CollectedHeap::heap()->next_compaction_region(this);
|
||||
}
|
||||
|
||||
void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue