< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page
rev 55322 : 8225550: Shenandoah: Prevent SH::object_iterate() call's side-effects

@@ -1277,11 +1277,16 @@
   Stack<oop,mtGC> oop_stack;
 
   // First, we process all GC roots. This populates the work stack with initial objects.
   ShenandoahAllRootScanner rp(1, ShenandoahPhaseTimings::_num_phases);
   ObjectIterateScanRootClosure oops(&_aux_bit_map, &oop_stack);
+
+  if (unload_classes()) {
+    rp.strong_roots_do_unchecked(&oops);
+  } else {
   rp.roots_do_unchecked(&oops);
+  }
 
   // Work through the oop stack to traverse heap.
   while (! oop_stack.is_empty()) {
     oop obj = oop_stack.pop();
     assert(oopDesc::is_oop(obj), "must be a valid oop");
< prev index next >