8231198: Shenandoah: heap walking should visit all roots most of the time

Reviewed-by: zgu, rkennke
This commit is contained in:
Aleksey Shipilev 2019-09-19 20:26:52 +02:00
parent f925696a0c
commit 289c30bdbc

@ -1296,7 +1296,10 @@ void ShenandoahHeap::object_iterate(ObjectClosure* cl) {
ShenandoahHeapIterationRootScanner rp;
ObjectIterateScanRootClosure oops(&_aux_bit_map, &oop_stack);
if (unload_classes()) {
// If we are unloading classes right now, we should not touch weak roots,
// on the off-chance we would evacuate them and make them live accidentally.
// In other cases, we have to scan all roots.
if (is_evacuation_in_progress() && unload_classes()) {
rp.strong_roots_do(&oops);
} else {
rp.roots_do(&oops);