< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahForwarding.inline.hpp

Print this page
@@ -28,10 +28,11 @@
  #include "gc/shenandoah/shenandoahForwarding.hpp"
  
  #include "gc/shenandoah/shenandoahAsserts.hpp"
  #include "oops/markWord.hpp"
  #include "runtime/javaThread.hpp"
+ #include "runtime/synchronizer.hpp"
  
  inline oop ShenandoahForwarding::get_forwardee_raw(oop obj) {
    shenandoah_assert_in_heap(nullptr, obj);
    return get_forwardee_raw_unchecked(obj);
  }

@@ -84,10 +85,11 @@
    markWord new_mark = markWord::encode_pointer_as_mark(update);
    markWord prev_mark = obj->cas_set_mark(new_mark, old_mark, memory_order_conservative);
    if (prev_mark == old_mark) {
      return update;
    } else {
+     assert(prev_mark.is_marked(), "must be forwarded");
      return cast_to_oop(prev_mark.clear_lock_bits().to_pointer());
    }
  }
  
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHFORWARDING_INLINE_HPP
< prev index next >