8224508: Shenandoah: Need to update thread roots in final mark for piggyback ref update cycle
authorzgu
Wed, 22 May 2019 07:12:18 -0400
changeset 54981 0b56fc0448ec
parent 54980 e2c952c7ff20
child 54982 b18c8301b8c2
8224508: Shenandoah: Need to update thread roots in final mark for piggyback ref update cycle Reviewed-by: shade, rkennke
src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Wed May 22 13:19:04 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp	Wed May 22 07:12:18 2019 -0400
@@ -1505,10 +1505,14 @@
   if (!cancelled_gc()) {
     concurrent_mark()->finish_mark_from_roots(/* full_gc = */ false);
 
-    // Degen may be caused by failed evacuation of roots
-    if (is_degenerated_gc_in_progress() && has_forwarded_objects()) {
-      concurrent_mark()->update_roots(ShenandoahPhaseTimings::degen_gc_update_roots);
-    }
+    if (has_forwarded_objects()) {
+      // Degen may be caused by failed evacuation of roots
+      if (is_degenerated_gc_in_progress()) {
+        concurrent_mark()->update_roots(ShenandoahPhaseTimings::degen_gc_update_roots);
+      } else {
+        concurrent_mark()->update_thread_roots(ShenandoahPhaseTimings::update_roots);
+      }
+   }
 
     if (ShenandoahVerify) {
       verifier()->verify_roots_no_forwarded();