< prev index next >

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

Print this page
@@ -34,10 +34,11 @@
  #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  #include "gc/shenandoah/shenandoahMetrics.hpp"
  #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
  #include "gc/shenandoah/shenandoahOldGeneration.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"

@@ -282,13 +283,19 @@
          op_update_refs();
          op_update_roots();
          assert(!heap->cancelled_gc(), "STW reference update can not OOM");
        }
  
-       // Disarm nmethods that armed in concurrent cycle.
-       // In above case, update roots should disarm them
-       ShenandoahCodeRoots::disarm_nmethods();
+       if (ShenandoahGCStateCheckHotpatch) {
+         // Leaving degenerated GC, we need to flip barriers back to idle.
+         ShenandoahCodeRoots::arm_nmethods();
+         ShenandoahStackWatermark::change_epoch_id();
+       } else {
+         // Disarm nmethods that armed in concurrent cycle.
+         // In above case, update roots should disarm them
+         ShenandoahCodeRoots::disarm_nmethods();
+       }
  
        op_cleanup_complete();
  
        if (heap->mode()->is_generational()) {
          ShenandoahGenerationalHeap::heap()->complete_degenerated_cycle();
< prev index next >