8231244: Shenandoah: all-roots heap walking misses some weak roots
authorshade
Thu, 19 Sep 2019 20:26:53 +0200
changeset 58233 89033e6641ed
parent 58232 de9d23469c68
child 58234 0cc0fd308822
8231244: Shenandoah: all-roots heap walking misses some weak roots Reviewed-by: zgu, rkennke
src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp
src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Thu Sep 19 20:26:52 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp	Thu Sep 19 20:26:53 2019 +0200
@@ -223,6 +223,7 @@
    CLDToOopClosure clds(oops, ClassLoaderData::_claim_none);
    MarkingCodeBlobClosure code(oops, !CodeBlobToOopClosure::FixRelocations);
    ShenandoahParallelOopsDoThreadClosure tc_cl(oops, &code, NULL);
+   AlwaysTrueClosure always_true;
    ResourceMark rm;
 
    _serial_roots.oops_do(oops, 0);
@@ -230,6 +231,10 @@
    _cld_roots.cld_do(&clds, 0);
    _thread_roots.threads_do(&tc_cl, 0);
    _code_roots.code_blobs_do(&code, 0);
+
+   _serial_weak_roots.weak_oops_do(oops, 0);
+   _weak_roots.oops_do<OopClosure>(oops, 0);
+   _dedup_roots.oops_do(&always_true, oops, 0);
  }
 
  void ShenandoahHeapIterationRootScanner::strong_roots_do(OopClosure* oops) {
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Thu Sep 19 20:26:52 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp	Thu Sep 19 20:26:53 2019 +0200
@@ -254,6 +254,9 @@
   ShenandoahVMRoots<false /*concurrent*/>                  _vm_roots;
   ShenandoahClassLoaderDataRoots<false /*concurrent*/, true /*single threaded*/>
                                                            _cld_roots;
+  ShenandoahSerialWeakRoots                                _serial_weak_roots;
+  ShenandoahWeakRoots<false /*concurrent*/>                _weak_roots;
+  ShenandoahStringDedupRoots                               _dedup_roots;
   ShenandoahCodeCacheRoots<ShenandoahAllCodeRootsIterator> _code_roots;
 
 public: