# HG changeset patch # User shade # Date 1559136321 -7200 # Node ID 335f474becde7fd969727b10d9dfbab7e1d16953 # Parent dd321e3596c0d7a6cb02bf473086436e4d6e36f7 8224970: ShenandoahRootScanner::roots_do assert is too strong Reviewed-by: zgu diff -r dd321e3596c0 -r 335f474becde src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp Wed May 29 13:58:05 2019 +0100 +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp Wed May 29 15:25:21 2019 +0200 @@ -27,6 +27,7 @@ #include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahRootProcessor.hpp" #include "gc/shenandoah/shenandoahTimingTracker.hpp" +#include "gc/shenandoah/shenandoahUtils.hpp" #include "memory/resourceArea.hpp" template @@ -90,9 +91,10 @@ template void ShenandoahRootScanner::roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure *tc) { - assert(!ShenandoahHeap::heap()->unload_classes() || + assert(!ShenandoahSafepoint::is_at_shenandoah_safepoint() || + !ShenandoahHeap::heap()->unload_classes() || ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc(), - "No class unloading or traversal GC"); + "Expect class unloading or traversal when Shenandoah cycle is running"); ShenandoahParallelOopsDoThreadClosure tc_cl(oops, code, tc); ResourceMark rm;