< prev index next >

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

Print this page
rev 57380 : 8234974: Shenandoah: Do concurrent roots even when no evacuation is necessary

@@ -153,11 +153,11 @@
     default:
       ShouldNotReachHere();
   }
 }
 
-void ShenandoahCodeRoots::prepare_concurrent_unloading() {
+void ShenandoahCodeRoots::arm_nmethods() {
   assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint");
   _disarmed_value ++;
   // 0 is reserved for new nmethod
   if (_disarmed_value == 0) {
     _disarmed_value = 1;

@@ -222,11 +222,13 @@
 
     ShenandoahReentrantLocker locker(nm_data->lock());
 
     // Heal oops and disarm
     ShenandoahEvacOOMScope evac_scope;
+    if (_heap->is_evacuation_in_progress()) {
     ShenandoahNMethod::heal_nmethod(nm);
+    }
     ShenandoahNMethod::disarm_nmethod(nm);
 
     // Clear compiled ICs and exception caches
     if (!nm->unload_nmethod_caches(_unloading_occurred)) {
       set_failed();
< prev index next >