# HG changeset patch # User zgu # Date 1597152345 14400 # Tue Aug 11 09:25:45 2020 -0400 # Node ID dd065f121770077e2fd69f657ecb614d7329effb # Parent efe48e82100516f409a3d7a6ea2dfd30ef0fa638 8251359: Shenandoah: filter null oops before calling enqueue/SATB barrier diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp @@ -77,6 +77,7 @@ } inline void ShenandoahBarrierSet::enqueue(oop obj) { + assert(!CompressedOops::is_null(obj), "checked by caller"); assert(_satb_mark_queue_set.is_active(), "only get here when SATB active"); // Filter marked objects before hitting the SATB queues. The same predicate would @@ -116,6 +117,7 @@ inline void ShenandoahBarrierSet::keep_alive_if_weak(DecoratorSet decorators, oop value) { assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known"); + assert(!CompressedOops::is_null(value), "checked by caller"); const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0; const bool peek = (decorators & AS_NO_KEEPALIVE) != 0; if (!peek && !on_strong_oop_ref) { @@ -125,6 +127,7 @@ template inline void ShenandoahBarrierSet::keep_alive_if_weak(oop value) { + assert(!CompressedOops::is_null(value), "checked by caller"); assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known"); if (!HasDecorator::value && !HasDecorator::value) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -1325,7 +1325,7 @@ // Keep alive an object that was loaded with AS_NO_KEEPALIVE. void ShenandoahHeap::keep_alive(oop obj) { - if (is_concurrent_mark_in_progress()) { + if (is_concurrent_mark_in_progress() && !CompressedOops::is_null(obj)) { ShenandoahBarrierSet::barrier_set()->enqueue(obj); } }