src/hotspot/share/gc/g1/g1CollectionSet.cpp
changeset 48889 216c2aabbf1f
parent 47681 149745044e48
child 48890 f9884e190f2b
equal deleted inserted replaced
48779:fdc2a952e8fe 48889:216c2aabbf1f
   184   size_t start_pos = (worker_id * len) / total_workers;
   184   size_t start_pos = (worker_id * len) / total_workers;
   185   size_t cur_pos = start_pos;
   185   size_t cur_pos = start_pos;
   186 
   186 
   187   do {
   187   do {
   188     HeapRegion* r = G1CollectedHeap::heap()->region_at(_collection_set_regions[cur_pos]);
   188     HeapRegion* r = G1CollectedHeap::heap()->region_at(_collection_set_regions[cur_pos]);
   189     bool result = cl->doHeapRegion(r);
   189     bool result = cl->do_heap_region(r);
   190     if (result) {
   190     if (result) {
   191       cl->incomplete();
   191       cl->set_incomplete();
   192       return;
   192       return;
   193     }
   193     }
   194     cur_pos++;
   194     cur_pos++;
   195     if (cur_pos == len) {
   195     if (cur_pos == len) {
   196       cur_pos = 0;
   196       cur_pos = 0;
   290 public:
   290 public:
   291   bool _valid;
   291   bool _valid;
   292 public:
   292 public:
   293   G1VerifyYoungAgesClosure() : HeapRegionClosure(), _valid(true) { }
   293   G1VerifyYoungAgesClosure() : HeapRegionClosure(), _valid(true) { }
   294 
   294 
   295   virtual bool doHeapRegion(HeapRegion* r) {
   295   virtual bool do_heap_region(HeapRegion* r) {
   296     guarantee(r->is_young(), "Region must be young but is %s", r->get_type_str());
   296     guarantee(r->is_young(), "Region must be young but is %s", r->get_type_str());
   297 
   297 
   298     SurvRateGroup* group = r->surv_rate_group();
   298     SurvRateGroup* group = r->surv_rate_group();
   299 
   299 
   300     if (group == NULL) {
   300     if (group == NULL) {
   330 class G1PrintCollectionSetClosure : public HeapRegionClosure {
   330 class G1PrintCollectionSetClosure : public HeapRegionClosure {
   331   outputStream* _st;
   331   outputStream* _st;
   332 public:
   332 public:
   333   G1PrintCollectionSetClosure(outputStream* st) : HeapRegionClosure(), _st(st) { }
   333   G1PrintCollectionSetClosure(outputStream* st) : HeapRegionClosure(), _st(st) { }
   334 
   334 
   335   virtual bool doHeapRegion(HeapRegion* r) {
   335   virtual bool do_heap_region(HeapRegion* r) {
   336     assert(r->in_collection_set(), "Region %u should be in collection set", r->hrm_index());
   336     assert(r->in_collection_set(), "Region %u should be in collection set", r->hrm_index());
   337     _st->print_cr("  " HR_FORMAT ", P: " PTR_FORMAT "N: " PTR_FORMAT ", age: %4d",
   337     _st->print_cr("  " HR_FORMAT ", P: " PTR_FORMAT "N: " PTR_FORMAT ", age: %4d",
   338                   HR_FORMAT_PARAMS(r),
   338                   HR_FORMAT_PARAMS(r),
   339                   p2i(r->prev_top_at_mark_start()),
   339                   p2i(r->prev_top_at_mark_start()),
   340                   p2i(r->next_top_at_mark_start()),
   340                   p2i(r->next_top_at_mark_start()),
   522   }
   522   }
   523   ~G1VerifyYoungCSetIndicesClosure() {
   523   ~G1VerifyYoungCSetIndicesClosure() {
   524     FREE_C_HEAP_ARRAY(int, _heap_region_indices);
   524     FREE_C_HEAP_ARRAY(int, _heap_region_indices);
   525   }
   525   }
   526 
   526 
   527   virtual bool doHeapRegion(HeapRegion* r) {
   527   virtual bool do_heap_region(HeapRegion* r) {
   528     const int idx = r->young_index_in_cset();
   528     const int idx = r->young_index_in_cset();
   529 
   529 
   530     assert(idx > -1, "Young index must be set for all regions in the incremental collection set but is not for region %u.", r->hrm_index());
   530     assert(idx > -1, "Young index must be set for all regions in the incremental collection set but is not for region %u.", r->hrm_index());
   531     assert((size_t)idx < _young_length, "Young cset index too large for region %u", r->hrm_index());
   531     assert((size_t)idx < _young_length, "Young cset index too large for region %u", r->hrm_index());
   532 
   532