Merge
This commit is contained in:
commit
a1901aecc9
@ -253,7 +253,7 @@ void MutatorAllocRegion::retire_region(HeapRegion* alloc_region,
|
|||||||
HeapRegion* G1GCAllocRegion::allocate_new_region(size_t word_size,
|
HeapRegion* G1GCAllocRegion::allocate_new_region(size_t word_size,
|
||||||
bool force) {
|
bool force) {
|
||||||
assert(!force, "not supported for GC alloc regions");
|
assert(!force, "not supported for GC alloc regions");
|
||||||
return _g1h->new_gc_alloc_region(word_size, count(), _purpose);
|
return _g1h->new_gc_alloc_region(word_size, _purpose);
|
||||||
}
|
}
|
||||||
|
|
||||||
void G1GCAllocRegion::retire_region(HeapRegion* alloc_region,
|
void G1GCAllocRegion::retire_region(HeapRegion* alloc_region,
|
||||||
|
@ -5361,13 +5361,23 @@ void G1CollectedHeap::retire_mutator_alloc_region(HeapRegion* alloc_region,
|
|||||||
|
|
||||||
// Methods for the GC alloc regions
|
// Methods for the GC alloc regions
|
||||||
|
|
||||||
HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size,
|
bool G1CollectedHeap::has_more_regions(InCSetState dest) {
|
||||||
uint count,
|
if (dest.is_old()) {
|
||||||
InCSetState dest) {
|
return true;
|
||||||
|
} else {
|
||||||
|
return young_list()->survivor_length() < g1_policy()->max_survivor_regions();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size, InCSetState dest) {
|
||||||
assert(FreeList_lock->owned_by_self(), "pre-condition");
|
assert(FreeList_lock->owned_by_self(), "pre-condition");
|
||||||
|
|
||||||
if (count < g1_policy()->max_regions(dest)) {
|
if (!has_more_regions(dest)) {
|
||||||
const bool is_survivor = (dest.is_young());
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool is_survivor = dest.is_young();
|
||||||
|
|
||||||
HeapRegion* new_alloc_region = new_region(word_size,
|
HeapRegion* new_alloc_region = new_region(word_size,
|
||||||
!is_survivor,
|
!is_survivor,
|
||||||
true /* do_expand */);
|
true /* do_expand */);
|
||||||
@ -5378,6 +5388,7 @@ HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size,
|
|||||||
new_alloc_region->record_timestamp();
|
new_alloc_region->record_timestamp();
|
||||||
if (is_survivor) {
|
if (is_survivor) {
|
||||||
new_alloc_region->set_survivor();
|
new_alloc_region->set_survivor();
|
||||||
|
young_list()->add_survivor_region(new_alloc_region);
|
||||||
_verifier->check_bitmaps("Survivor Region Allocation", new_alloc_region);
|
_verifier->check_bitmaps("Survivor Region Allocation", new_alloc_region);
|
||||||
} else {
|
} else {
|
||||||
new_alloc_region->set_old();
|
new_alloc_region->set_old();
|
||||||
@ -5388,7 +5399,6 @@ HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size,
|
|||||||
new_alloc_region->note_start_of_copying(during_im);
|
new_alloc_region->note_start_of_copying(during_im);
|
||||||
return new_alloc_region;
|
return new_alloc_region;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5398,9 +5408,7 @@ void G1CollectedHeap::retire_gc_alloc_region(HeapRegion* alloc_region,
|
|||||||
bool during_im = collector_state()->during_initial_mark_pause();
|
bool during_im = collector_state()->during_initial_mark_pause();
|
||||||
alloc_region->note_end_of_copying(during_im);
|
alloc_region->note_end_of_copying(during_im);
|
||||||
g1_policy()->record_bytes_copied_during_gc(allocated_bytes);
|
g1_policy()->record_bytes_copied_during_gc(allocated_bytes);
|
||||||
if (dest.is_young()) {
|
if (dest.is_old()) {
|
||||||
young_list()->add_survivor_region(alloc_region);
|
|
||||||
} else {
|
|
||||||
_old_set.add(alloc_region);
|
_old_set.add(alloc_region);
|
||||||
}
|
}
|
||||||
_hr_printer.retire(alloc_region);
|
_hr_printer.retire(alloc_region);
|
||||||
|
@ -471,8 +471,8 @@ protected:
|
|||||||
size_t allocated_bytes);
|
size_t allocated_bytes);
|
||||||
|
|
||||||
// For GC alloc regions.
|
// For GC alloc regions.
|
||||||
HeapRegion* new_gc_alloc_region(size_t word_size, uint count,
|
bool has_more_regions(InCSetState dest);
|
||||||
InCSetState dest);
|
HeapRegion* new_gc_alloc_region(size_t word_size, InCSetState dest);
|
||||||
void retire_gc_alloc_region(HeapRegion* alloc_region,
|
void retire_gc_alloc_region(HeapRegion* alloc_region,
|
||||||
size_t allocated_bytes, InCSetState dest);
|
size_t allocated_bytes, InCSetState dest);
|
||||||
|
|
||||||
|
@ -420,22 +420,6 @@ public:
|
|||||||
return _max_survivor_regions;
|
return _max_survivor_regions;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint REGIONS_UNLIMITED = (uint) -1;
|
|
||||||
|
|
||||||
uint max_regions(InCSetState dest) const {
|
|
||||||
switch (dest.value()) {
|
|
||||||
case InCSetState::Young:
|
|
||||||
return _max_survivor_regions;
|
|
||||||
case InCSetState::Old:
|
|
||||||
return REGIONS_UNLIMITED;
|
|
||||||
default:
|
|
||||||
assert(false, "Unknown dest state: " CSETSTATE_FORMAT, dest.value());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// keep some compilers happy
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void note_start_adding_survivor_regions() {
|
void note_start_adding_survivor_regions() {
|
||||||
_survivor_surv_rate_group->start_adding_regions();
|
_survivor_surv_rate_group->start_adding_regions();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user