< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp

Print this page
rev 56326 : 8231250: Shenandoah: Shenandoah assert_correct failed; Object klass pointer

@@ -464,21 +464,17 @@
   bool on_oop = type == T_OBJECT || type == T_ARRAY;
   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   bool not_in_heap = (decorators & IN_NATIVE) != 0;
   bool on_reference = on_weak || on_phantom;
-  bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
+  bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
+  bool keep_alive = ((decorators & AS_NO_KEEPALIVE) == 0) || is_traversal_mode;
 
   BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread);
   if (on_oop) {
-    if (not_in_heap) {
-      if (ShenandoahHeap::heap()->is_traversal_mode()) {
-        load_reference_barrier(masm, dst);
-        keep_alive = true;
-      } else {
+    if (not_in_heap && !is_traversal_mode) {
         load_reference_barrier_native(masm, dst);
-      }
     } else {
       load_reference_barrier(masm, dst);
     }
 
     if (ShenandoahKeepAliveBarrier && on_reference && keep_alive) {
< prev index next >