8231244: Shenandoah: all-roots heap walking misses some weak roots

Reviewed-by: zgu, rkennke
This commit is contained in:
Aleksey Shipilev 2019-09-19 20:26:53 +02:00
parent 289c30bdbc
commit 7a02f30492
2 changed files with 8 additions and 0 deletions

@ -223,6 +223,7 @@ void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) {
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 @@ void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) {
_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) {

@ -254,6 +254,9 @@ private:
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: