RFR: ShenandoahBarrierSet::AB::cmpxchg must call non-oop super implementation

Roman Kennke rkennke at redhat.com
Thu Jul 5 12:03:48 UTC 2018


This is a really bad snafu: the primitive cmpxchg in SBS::AB is calling
the oop-cmpxchg super implementation. This will not go well, because
super may have different width and even worse, it will try to
(un-)compress the value as oop.

Fix:

# HG changeset patch
# User rkennke
# Date 1530792124 -7200
#      Thu Jul 05 14:02:04 2018 +0200
# Node ID c7ee69eee5073cb21a6fee90e0332b0cd3141069
# Parent  38239dd666a162451120df9075b257c6b22d3db1
ShenandoahBarrierSet::AB::cmpxchg must call non-oop super implementation

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
@@ -190,7 +190,7 @@
     template <typename T>
     static T atomic_cmpxchg_in_heap_at(T new_value, oop base, ptrdiff_t
offset, T compare_value) {
       base = ShenandoahBarrierSet::barrier_set()->write_barrier(base);
-      return Raw::oop_atomic_cmpxchg_at(new_value, base, offset,
compare_value);
+      return Raw::atomic_cmpxchg_at(new_value, base, offset,
compare_value);
     }

     template <typename T>



More information about the shenandoah-dev mailing list