< prev index next >

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

Print this page
@@ -29,10 +29,11 @@
  #include "gc/shenandoah/shenandoahGenerationalHeap.hpp"
  #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
  #include "gc/shenandoah/shenandoahOldGC.hpp"
  #include "gc/shenandoah/shenandoahOldGeneration.hpp"
+ #include "gc/shenandoah/shenandoahStackWatermark.hpp"
  #include "gc/shenandoah/shenandoahYoungGeneration.hpp"
  #include "prims/jvmtiTagMap.hpp"
  #include "utilities/events.hpp"
  
  

@@ -71,10 +72,14 @@
  
      if (VerifyAfterGC) {
        Universe::verify();
      }
  
+     // Arm nmethods/stack for concurrent processing
+     ShenandoahCodeRoots::arm_nmethods();
+     ShenandoahStackWatermark::change_epoch_id();
+ 
      {
        ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::final_mark_propagate_gc_state);
        heap->propagate_gc_state_to_all_threads();
      }
    }

@@ -132,11 +137,19 @@
  
    // We must execute this vm operation if we completed final mark. We cannot
    // return from here with weak roots in progress. This is not a valid gc state
    // for any young collections (or allocation failures) that interrupt the old
    // collection.
-   heap->concurrent_final_roots();
+   // Arm the nmethods to possibly flip the barriers to idle.
+   vmop_entry_final_roots(true);
+ 
+   // Now we are back at concurrent phase, process nmethods to fix their barriers.
+   // TODO: Is it safe to do when young GC is running?
+   {
+     ShenandoahConcurrentPhase gc_phase("Concurrent disarm", ShenandoahPhaseTimings::conc_disarm);
+     ShenandoahCodeRoots::disarm_nmethods();
+   }
  
    // After concurrent old marking finishes, we reclaim immediate garbage. Further, we may also want to expand OLD in order
    // to make room for anticipated promotions and/or for mixed evacuations.  Mixed evacuations are especially likely to
    // follow the end of OLD marking.
    heap->rebuild_free_set_within_phase();
< prev index next >