This commit is contained in:
Thomas Schatzl 2015-08-07 23:01:50 +02:00
commit a6609275c8
4 changed files with 19 additions and 17 deletions

View File

@ -67,11 +67,11 @@ void G1Allocator::reuse_retained_old_region(EvacuationInfo& evacuation_info,
// retired. We have to remove it now, since we don't allow regions
// we allocate to in the region sets. We'll re-add it later, when
// it's retired again.
_g1h->_old_set.remove(retained_region);
_g1h->old_set_remove(retained_region);
bool during_im = _g1h->collector_state()->during_initial_mark_pause();
retained_region->note_start_of_copying(during_im);
old->set(retained_region);
_g1h->_hr_printer.reuse(retained_region);
_g1h->hr_printer()->reuse(retained_region);
evacuation_info.set_alloc_regions_used_before(retained_region->used());
}
}
@ -264,8 +264,8 @@ bool G1ArchiveAllocator::alloc_new_region() {
}
assert(hr->is_empty(), err_msg("expected empty region (index %u)", hr->hrm_index()));
hr->set_archive();
_g1h->_old_set.add(hr);
_g1h->_hr_printer.alloc(hr, G1HRPrinter::Archive);
_g1h->old_set_add(hr);
_g1h->hr_printer()->alloc(hr, G1HRPrinter::Archive);
_allocated_regions.append(hr);
_allocation_region = hr;

View File

@ -6495,7 +6495,6 @@ HeapRegion* G1CollectedHeap::alloc_highest_free_region() {
return NULL;
}
// Heap region set verification
class VerifyRegionListsClosure : public HeapRegionClosure {

View File

@ -186,8 +186,6 @@ class G1CollectedHeap : public CollectedHeap {
friend class MutatorAllocRegion;
friend class SurvivorGCAllocRegion;
friend class OldGCAllocRegion;
friend class G1Allocator;
friend class G1ArchiveAllocator;
// Closures used in implementation.
friend class G1ParScanThreadState;
@ -534,12 +532,6 @@ protected:
AllocationContext_t context,
bool expect_null_mutator_alloc_region);
// It dirties the cards that cover the block so that so that the post
// write barrier never queues anything when updating objects on this
// block. It is assumed (and in fact we assert) that the block
// belongs to a young region.
inline void dirty_young_block(HeapWord* start, size_t word_size);
// These methods are the "callbacks" from the G1AllocRegion class.
// For mutator alloc regions.
@ -553,10 +545,6 @@ protected:
void retire_gc_alloc_region(HeapRegion* alloc_region,
size_t allocated_bytes, InCSetState dest);
// Allocate the highest free region in the reserved heap. This will commit
// regions as necessary.
HeapRegion* alloc_highest_free_region();
// - if explicit_gc is true, the GC is for a System.gc() or a heap
// inspection request and should collect the entire heap
// - if clear_all_soft_refs is true, all soft references should be
@ -692,6 +680,10 @@ public:
// Allocates a new heap region instance.
HeapRegion* new_heap_region(uint hrs_index, MemRegion mr);
// Allocate the highest free region in the reserved heap. This will commit
// regions as necessary.
HeapRegion* alloc_highest_free_region();
// Frees a non-humongous region by initializing its contents and
// adding it to the free list that's passed as a parameter (this is
// usually a local list which will be appended to the master free
@ -705,6 +697,12 @@ public:
bool par,
bool locked = false);
// It dirties the cards that cover the block so that the post
// write barrier never queues anything when updating objects on this
// block. It is assumed (and in fact we assert) that the block
// belongs to a young region.
inline void dirty_young_block(HeapWord* start, size_t word_size);
// Frees a humongous region by collapsing it into individual regions
// and calling free_region() for each of them. The freed regions
// will be added to the free list that's passed as a parameter (this
@ -1183,6 +1181,7 @@ public:
}
}
inline void old_set_add(HeapRegion* hr);
inline void old_set_remove(HeapRegion* hr);
size_t non_young_capacity_bytes() {

View File

@ -107,6 +107,10 @@ inline void G1CollectedHeap::increment_gc_time_stamp() {
OrderAccess::fence();
}
inline void G1CollectedHeap::old_set_add(HeapRegion* hr) {
_old_set.add(hr);
}
inline void G1CollectedHeap::old_set_remove(HeapRegion* hr) {
_old_set.remove(hr);
}