comparison src/share/vm/gc_implementation/g1/heapRegion.cpp @ 20304:a22acf6d7598

8048112: G1 Full GC needs to support the case when the very first region is not available Summary: Refactor preparation for compaction during Full GC so that it lazily initializes the first compaction point. This also avoids problems later when the first region may not be committed. Also reviewed by K. Barrett. Reviewed-by: brutisso
author tschatzl
date Mon, 21 Jul 2014 10:00:31 +0200
parents 2c6ef90f030a
children 6701abbc4441
comparison
equal deleted inserted replaced
20303:c512f38a5139 20304:a22acf6d7598
378 378
379 assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant."); 379 assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant.");
380 } 380 }
381 381
382 CompactibleSpace* HeapRegion::next_compaction_space() const { 382 CompactibleSpace* HeapRegion::next_compaction_space() const {
383 // We're not using an iterator given that it will wrap around when 383 return G1CollectedHeap::heap()->next_compaction_region(this);
384 // it reaches the last region and this is not what we want here.
385 G1CollectedHeap* g1h = G1CollectedHeap::heap();
386 uint index = hrs_index() + 1;
387 while (index < g1h->n_regions()) {
388 HeapRegion* hr = g1h->region_at(index);
389 if (!hr->isHumongous()) {
390 return hr;
391 }
392 index += 1;
393 }
394 return NULL;
395 } 384 }
396 385
397 void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark, 386 void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark,
398 bool during_conc_mark) { 387 bool during_conc_mark) {
399 // We always recreate the prev marking info and we'll explicitly 388 // We always recreate the prev marking info and we'll explicitly