< prev index next >
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Print this page
rev 48820 : [mq]: 8196602-heapregionclosure-renaming
*** 1008,1018 ****
class PostCompactionPrinterClosure: public HeapRegionClosure {
private:
G1HRPrinter* _hr_printer;
public:
! bool doHeapRegion(HeapRegion* hr) {
assert(!hr->is_young(), "not expecting to find young regions");
_hr_printer->post_compaction(hr);
return false;
}
--- 1008,1018 ----
class PostCompactionPrinterClosure: public HeapRegionClosure {
private:
G1HRPrinter* _hr_printer;
public:
! bool do_heap_region(HeapRegion* hr) {
assert(!hr->is_young(), "not expecting to find young regions");
_hr_printer->post_compaction(hr);
return false;
}
*** 1915,1925 ****
public:
CheckGCTimeStampsHRClosure(unsigned gc_time_stamp) :
_gc_time_stamp(gc_time_stamp), _failures(false) { }
! virtual bool doHeapRegion(HeapRegion* hr) {
unsigned region_gc_time_stamp = hr->get_gc_time_stamp();
if (_gc_time_stamp != region_gc_time_stamp) {
log_error(gc, verify)("Region " HR_FORMAT " has GC time stamp = %d, expected %d", HR_FORMAT_PARAMS(hr),
region_gc_time_stamp, _gc_time_stamp);
_failures = true;
--- 1915,1925 ----
public:
CheckGCTimeStampsHRClosure(unsigned gc_time_stamp) :
_gc_time_stamp(gc_time_stamp), _failures(false) { }
! virtual bool do_heap_region(HeapRegion* hr) {
unsigned region_gc_time_stamp = hr->get_gc_time_stamp();
if (_gc_time_stamp != region_gc_time_stamp) {
log_error(gc, verify)("Region " HR_FORMAT " has GC time stamp = %d, expected %d", HR_FORMAT_PARAMS(hr),
region_gc_time_stamp, _gc_time_stamp);
_failures = true;
*** 1967,1977 ****
class SumUsedClosure: public HeapRegionClosure {
size_t _used;
public:
SumUsedClosure() : _used(0) {}
! bool doHeapRegion(HeapRegion* r) {
_used += r->used();
return false;
}
size_t result() { return _used; }
};
--- 1967,1977 ----
class SumUsedClosure: public HeapRegionClosure {
size_t _used;
public:
SumUsedClosure() : _used(0) {}
! bool do_heap_region(HeapRegion* r) {
_used += r->used();
return false;
}
size_t result() { return _used; }
};
*** 2186,2196 ****
class IterateObjectClosureRegionClosure: public HeapRegionClosure {
ObjectClosure* _cl;
public:
IterateObjectClosureRegionClosure(ObjectClosure* cl) : _cl(cl) {}
! bool doHeapRegion(HeapRegion* r) {
if (!r->is_continues_humongous()) {
r->object_iterate(_cl);
}
return false;
}
--- 2186,2196 ----
class IterateObjectClosureRegionClosure: public HeapRegionClosure {
ObjectClosure* _cl;
public:
IterateObjectClosureRegionClosure(ObjectClosure* cl) : _cl(cl) {}
! bool do_heap_region(HeapRegion* r) {
if (!r->is_continues_humongous()) {
r->object_iterate(_cl);
}
return false;
}
*** 2301,2311 ****
class PrintRegionClosure: public HeapRegionClosure {
outputStream* _st;
public:
PrintRegionClosure(outputStream* st) : _st(st) {}
! bool doHeapRegion(HeapRegion* r) {
r->print_on(_st);
return false;
}
};
--- 2301,2311 ----
class PrintRegionClosure: public HeapRegionClosure {
outputStream* _st;
public:
PrintRegionClosure(outputStream* st) : _st(st) {}
! bool do_heap_region(HeapRegion* r) {
r->print_on(_st);
return false;
}
};
*** 2420,2430 ****
private:
const char* _msg;
size_t _occupied_sum;
public:
! bool doHeapRegion(HeapRegion* r) {
HeapRegionRemSet* hrrs = r->rem_set();
size_t occupied = hrrs->occupied();
_occupied_sum += occupied;
tty->print_cr("Printing RSet for region " HR_FORMAT, HR_FORMAT_PARAMS(r));
--- 2420,2430 ----
private:
const char* _msg;
size_t _occupied_sum;
public:
! bool do_heap_region(HeapRegion* r) {
HeapRegionRemSet* hrrs = r->rem_set();
size_t occupied = hrrs->occupied();
_occupied_sum += occupied;
tty->print_cr("Printing RSet for region " HR_FORMAT, HR_FORMAT_PARAMS(r));
*** 2667,2677 ****
: _total_humongous(0),
_candidate_humongous(0),
_dcq(&JavaThread::dirty_card_queue_set()) {
}
! virtual bool doHeapRegion(HeapRegion* r) {
if (!r->is_starts_humongous()) {
return false;
}
G1CollectedHeap* g1h = G1CollectedHeap::heap();
--- 2667,2677 ----
: _total_humongous(0),
_candidate_humongous(0),
_dcq(&JavaThread::dirty_card_queue_set()) {
}
! virtual bool do_heap_region(HeapRegion* r) {
if (!r->is_starts_humongous()) {
return false;
}
G1CollectedHeap* g1h = G1CollectedHeap::heap();
*** 2743,2753 ****
cl.flush_rem_set_entries();
}
class VerifyRegionRemSetClosure : public HeapRegionClosure {
public:
! bool doHeapRegion(HeapRegion* hr) {
if (!hr->is_archive() && !hr->is_continues_humongous()) {
hr->verify_rem_set();
}
return false;
}
--- 2743,2753 ----
cl.flush_rem_set_entries();
}
class VerifyRegionRemSetClosure : public HeapRegionClosure {
public:
! bool do_heap_region(HeapRegion* hr) {
if (!hr->is_archive() && !hr->is_continues_humongous()) {
hr->verify_rem_set();
}
return false;
}
*** 2813,2823 ****
private:
G1HRPrinter* _hr_printer;
public:
G1PrintCollectionSetClosure(G1HRPrinter* hr_printer) : HeapRegionClosure(), _hr_printer(hr_printer) { }
! virtual bool doHeapRegion(HeapRegion* r) {
_hr_printer->cset(r);
return false;
}
};
--- 2813,2823 ----
private:
G1HRPrinter* _hr_printer;
public:
G1PrintCollectionSetClosure(G1HRPrinter* hr_printer) : HeapRegionClosure(), _hr_printer(hr_printer) { }
! virtual bool do_heap_region(HeapRegion* r) {
_hr_printer->cset(r);
return false;
}
};
*** 4503,4513 ****
_failure_used_words(0),
_failure_waste_words(0),
_local_free_list("Local Region List for CSet Freeing") {
}
! virtual bool doHeapRegion(HeapRegion* r) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
assert(r->in_collection_set(), "Region %u should be in collection set.", r->hrm_index());
g1h->clear_in_cset(r);
--- 4503,4513 ----
_failure_used_words(0),
_failure_waste_words(0),
_local_free_list("Local Region List for CSet Freeing") {
}
! virtual bool do_heap_region(HeapRegion* r) {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
assert(r->in_collection_set(), "Region %u should be in collection set.", r->hrm_index());
g1h->clear_in_cset(r);
*** 4626,4636 ****
size_t _cur_idx;
WorkItem* _work_items;
public:
G1PrepareFreeCollectionSetClosure(WorkItem* work_items) : HeapRegionClosure(), _cur_idx(0), _work_items(work_items) { }
! virtual bool doHeapRegion(HeapRegion* r) {
_work_items[_cur_idx++] = WorkItem(r);
return false;
}
};
--- 4626,4636 ----
size_t _cur_idx;
WorkItem* _work_items;
public:
G1PrepareFreeCollectionSetClosure(WorkItem* work_items) : HeapRegionClosure(), _cur_idx(0), _work_items(work_items) { }
! virtual bool do_heap_region(HeapRegion* r) {
_work_items[_cur_idx++] = WorkItem(r);
return false;
}
};
*** 4760,4770 ****
G1FreeHumongousRegionClosure(FreeRegionList* free_region_list) :
_free_region_list(free_region_list), _humongous_objects_reclaimed(0), _humongous_regions_reclaimed(0), _freed_bytes(0) {
}
! virtual bool doHeapRegion(HeapRegion* r) {
if (!r->is_starts_humongous()) {
return false;
}
G1CollectedHeap* g1h = G1CollectedHeap::heap();
--- 4760,4770 ----
G1FreeHumongousRegionClosure(FreeRegionList* free_region_list) :
_free_region_list(free_region_list), _humongous_objects_reclaimed(0), _humongous_regions_reclaimed(0), _freed_bytes(0) {
}
! virtual bool do_heap_region(HeapRegion* r) {
if (!r->is_starts_humongous()) {
return false;
}
G1CollectedHeap* g1h = G1CollectedHeap::heap();
*** 4895,4905 ****
cl.humongous_objects_reclaimed());
}
class G1AbandonCollectionSetClosure : public HeapRegionClosure {
public:
! virtual bool doHeapRegion(HeapRegion* r) {
assert(r->in_collection_set(), "Region %u must have been in collection set", r->hrm_index());
G1CollectedHeap::heap()->clear_in_cset(r);
r->set_young_index_in_cset(-1);
return false;
}
--- 4895,4905 ----
cl.humongous_objects_reclaimed());
}
class G1AbandonCollectionSetClosure : public HeapRegionClosure {
public:
! virtual bool do_heap_region(HeapRegion* r) {
assert(r->in_collection_set(), "Region %u must have been in collection set", r->hrm_index());
G1CollectedHeap::heap()->clear_in_cset(r);
r->set_young_index_in_cset(-1);
return false;
}
*** 4965,4975 ****
class NoYoungRegionsClosure: public HeapRegionClosure {
private:
bool _success;
public:
NoYoungRegionsClosure() : _success(true) { }
! bool doHeapRegion(HeapRegion* r) {
if (r->is_young()) {
log_error(gc, verify)("Region [" PTR_FORMAT ", " PTR_FORMAT ") tagged as young",
p2i(r->bottom()), p2i(r->end()));
_success = false;
}
--- 4965,4975 ----
class NoYoungRegionsClosure: public HeapRegionClosure {
private:
bool _success;
public:
NoYoungRegionsClosure() : _success(true) { }
! bool do_heap_region(HeapRegion* r) {
if (r->is_young()) {
log_error(gc, verify)("Region [" PTR_FORMAT ", " PTR_FORMAT ") tagged as young",
p2i(r->bottom()), p2i(r->end()));
_success = false;
}
*** 4995,5005 ****
HeapRegionSet *_old_set;
public:
TearDownRegionSetsClosure(HeapRegionSet* old_set) : _old_set(old_set) { }
! bool doHeapRegion(HeapRegion* r) {
if (r->is_old()) {
_old_set->remove(r);
} else if(r->is_young()) {
r->uninstall_surv_rate_group();
} else {
--- 4995,5005 ----
HeapRegionSet *_old_set;
public:
TearDownRegionSetsClosure(HeapRegionSet* old_set) : _old_set(old_set) { }
! bool do_heap_region(HeapRegion* r) {
if (r->is_old()) {
_old_set->remove(r);
} else if(r->is_young()) {
r->uninstall_surv_rate_group();
} else {
*** 5063,5073 ****
if (!free_list_only) {
assert(_old_set->is_empty(), "pre-condition");
}
}
! bool doHeapRegion(HeapRegion* r) {
if (r->is_empty()) {
// Add free regions to the free list
r->set_free();
r->set_allocation_context(AllocationContext::system());
_hrm->insert_into_free_list(r);
--- 5063,5073 ----
if (!free_list_only) {
assert(_old_set->is_empty(), "pre-condition");
}
}
! bool do_heap_region(HeapRegion* r) {
if (r->is_empty()) {
// Add free regions to the free list
r->set_free();
r->set_allocation_context(AllocationContext::system());
_hrm->insert_into_free_list(r);
< prev index next >