< prev index next >

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

Print this page
@@ -50,10 +50,11 @@
  #include "gc/shenandoah/shenandoahMetrics.hpp"
  #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
  #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  #include "gc/shenandoah/shenandoahReferenceProcessor.hpp"
  #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
+ #include "gc/shenandoah/shenandoahStackWatermark.hpp"
  #include "gc/shenandoah/shenandoahSTWMark.hpp"
  #include "gc/shenandoah/shenandoahUtils.hpp"
  #include "gc/shenandoah/shenandoahVerifier.hpp"
  #include "gc/shenandoah/shenandoahVMOperations.hpp"
  #include "gc/shenandoah/shenandoahWorkerPolicy.hpp"

@@ -126,10 +127,18 @@
  
    // Regardless if progress was made, we record that we completed a "successful" full GC.
    _generation->heuristics()->record_success_full();
    heap->shenandoah_policy()->record_success_full();
  
+   // Leaving full GC, we need to flip barriers back to idle.
+   ShenandoahCodeRoots::arm_nmethods();
+ 
+   // There is no operation that follows Full GC, so run all nmethod barriers now.
+   // We will take additional time during the safepoint, but we would also incur no
+   // additional latency on mutators once we return from here.
+   ShenandoahCodeRoots::disarm_nmethods();
+ 
    {
      ShenandoahTimingsTracker timing(ShenandoahPhaseTimings::full_gc_propagate_gc_state);
      heap->propagate_gc_state_to_all_threads();
    }
  }
< prev index next >