< prev index next >

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

Print this page
rev 55208 : imported patch 8220089.webrev.0
rev 55210 : imported patch 8220089.webrev.2
rev 55211 : imported patch 8220089.webrev.3
rev 55212 : imported patch 8220089.webrev.4

*** 39,54 **** _survivor_is_full(false), _old_is_full(false), _mutator_alloc_region(), _survivor_gc_alloc_region(heap->alloc_buffer_stats(G1HeapRegionAttr::Young)), _old_gc_alloc_region(heap->alloc_buffer_stats(G1HeapRegionAttr::Old)), ! _retained_old_gc_alloc_region(NULL) { } void G1Allocator::init_mutator_alloc_region() { assert(_mutator_alloc_region.get() == NULL, "pre-condition"); _mutator_alloc_region.init(); } void G1Allocator::release_mutator_alloc_region() { _mutator_alloc_region.release(); assert(_mutator_alloc_region.get() == NULL, "post-condition"); --- 39,67 ---- _survivor_is_full(false), _old_is_full(false), _mutator_alloc_region(), _survivor_gc_alloc_region(heap->alloc_buffer_stats(G1HeapRegionAttr::Young)), _old_gc_alloc_region(heap->alloc_buffer_stats(G1HeapRegionAttr::Old)), ! _retained_old_gc_alloc_region(NULL), ! _retained_survivor_gc_alloc_region(NULL) { } void G1Allocator::init_mutator_alloc_region() { assert(_mutator_alloc_region.get() == NULL, "pre-condition"); _mutator_alloc_region.init(); + + reuse_retained_survivor_region(&_retained_survivor_gc_alloc_region); + } + + void G1Allocator::reuse_retained_survivor_region(HeapRegion** retained_survivor) { + HeapRegion* retained_region = *retained_survivor; + *retained_survivor = NULL; + + if (retained_region != NULL) { + mutator_alloc_region()->set(retained_region); + _g1h->reuse_retained_survivor_region(retained_region); + } } void G1Allocator::release_mutator_alloc_region() { _mutator_alloc_region.release(); assert(_mutator_alloc_region.get() == NULL, "post-condition");
*** 105,115 **** } void G1Allocator::release_gc_alloc_regions(G1EvacuationInfo& evacuation_info) { evacuation_info.set_allocation_regions(survivor_gc_alloc_region()->count() + old_gc_alloc_region()->count()); ! survivor_gc_alloc_region()->release(); // If we have an old GC alloc region to release, we'll save it in // _retained_old_gc_alloc_region. If we don't // _retained_old_gc_alloc_region will become NULL. This is what we // want either way so no reason to check explicitly for either // condition. --- 118,133 ---- } void G1Allocator::release_gc_alloc_regions(G1EvacuationInfo& evacuation_info) { evacuation_info.set_allocation_regions(survivor_gc_alloc_region()->count() + old_gc_alloc_region()->count()); ! HeapRegion* reuse_candidate = survivor_gc_alloc_region()->release(); ! if (reuse_candidate != NULL && SurvivorGCAllocRegion::should_retain(reuse_candidate)) { ! _g1h->update_retained_survivor_gc_alloc_region(reuse_candidate); ! _retained_survivor_gc_alloc_region = reuse_candidate; ! } ! // If we have an old GC alloc region to release, we'll save it in // _retained_old_gc_alloc_region. If we don't // _retained_old_gc_alloc_region will become NULL. This is what we // want either way so no reason to check explicitly for either // condition.
< prev index next >