< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahVMOperations.cpp

Print this page
*** 25,10 ***
--- 25,11 ---
  #include "precompiled.hpp"
  
  #include "gc/shenandoah/shenandoahConcurrentGC.hpp"
  #include "gc/shenandoah/shenandoahDegeneratedGC.hpp"
  #include "gc/shenandoah/shenandoahFullGC.hpp"
+ #include "gc/shenandoah/shenandoahGeneration.hpp"
  #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  #include "gc/shenandoah/shenandoahMark.inline.hpp"
  #include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
  #include "gc/shenandoah/shenandoahUtils.hpp"
  #include "gc/shenandoah/shenandoahVMOperations.hpp"

*** 76,7 ***
--- 77,25 ---
    _gc->entry_final_updaterefs();
  }
  
  void VM_ShenandoahFinalRoots::doit() {
    ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT);
+   if (_incr_region_ages) {
+     // TODO: Do we even care about this?  Do we want to parallelize it?
+     ShenandoahHeap* heap = ShenandoahHeap::heap();
+     ShenandoahMarkingContext* ctx = heap->complete_marking_context();
+ 
+     for (size_t i = 0; i < heap->num_regions(); i++) {
+       ShenandoahHeapRegion *r = heap->get_region(i);
+       if (r->is_active() && r->is_young()) {
+         HeapWord* tams = ctx->top_at_mark_start(r);
+         HeapWord* top = r->top();
+         if (top > tams) {
+           r->reset_age();
+         } else {
+           r->increment_age();
+         }
+       }
+     }
+   }
    _gc->entry_final_roots();
  }
< prev index next >