--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp Thu May 02 06:33:28 2019 -0700
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp Thu May 02 09:49:52 2019 -0400
@@ -661,15 +661,13 @@
// anything to them.
void ShenandoahConcurrentMark::weak_roots_work() {
WorkGang* workers = _heap->workers();
- ShenandoahIsAliveSelector is_alive;
-
- if (_heap->has_forwarded_objects()) {
- ShenandoahWeakUpdateClosure cl;
- WeakProcessor::weak_oops_do(workers, is_alive.is_alive_closure(), &cl, 1);
- } else {
- ShenandoahWeakAssertNotForwardedClosure cl;
- WeakProcessor::weak_oops_do(workers, is_alive.is_alive_closure(), &cl, 1);
- }
+ OopClosure* keep_alive = &do_nothing_cl;
+#ifdef ASSERT
+ ShenandoahWeakAssertNotForwardedClosure verify_cl;
+ keep_alive = &verify_cl;
+#endif
+ ShenandoahIsAliveClosure is_alive;
+ WeakProcessor::weak_oops_do(workers, &is_alive, keep_alive, 1);
}
void ShenandoahConcurrentMark::weak_refs_work_doit(bool full_gc) {