# HG changeset patch # User rkennke # Date 1552921886 -3600 # Mon Mar 18 16:11:26 2019 +0100 # Node ID 316b94c870d137f798f573c2b06ec4b581acf60b # Parent 17bf38efed0e5e7d23030d18fc81330ba1222d71 8220780: ShenandoahBS::AccessBarrier::oop_store_in_heap_at ignores AS_NO_KEEPALIVE diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp @@ -226,7 +226,10 @@ template static void oop_store_in_heap(T* addr, oop value) { - ShenandoahBarrierSet::barrier_set()->write_ref_field_pre_work(addr, value); + const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0; + if (keep_alive) { + ShenandoahBarrierSet::barrier_set()->write_ref_field_pre_work(addr, value); + } Raw::oop_store(addr, value); } 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 @@ -58,7 +58,8 @@ expected = res; } while ((! oopDesc::equals_raw(compare_value, expected)) && oopDesc::equals_raw(resolve_forwarded(compare_value), resolve_forwarded(expected))); if (oopDesc::equals_raw(expected, compare_value)) { - if (ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value)) { + const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0; + if (keep_alive && ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value)) { ShenandoahBarrierSet::barrier_set()->enqueue(compare_value); } } @@ -70,7 +71,8 @@ inline oop ShenandoahBarrierSet::AccessBarrier::oop_atomic_xchg_in_heap(oop new_value, T* addr) { oop previous = Raw::oop_atomic_xchg(new_value, addr); if (ShenandoahSATBBarrier) { - if (!CompressedOops::is_null(previous)) { + const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0; + if (keep_alive && !CompressedOops::is_null(previous)) { ShenandoahBarrierSet::barrier_set()->enqueue(previous); } }