< prev index next >

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

Print this page
rev 59271 : 8240870: Shenandoah: merge evac and update phases
Reviewed-by: XXX

@@ -61,11 +61,11 @@
   oop fwd = resolve_forwarded_not_null_mutator(obj);
   if (obj == fwd) {
     assert(_heap->is_evacuation_in_progress(),
            "evac should be in progress");
     ShenandoahEvacOOMScope scope;
-    fwd = _heap->evacuate_object(obj, Thread::current());
+    fwd = _heap->evacuate_object_recursively(obj, load_addr, Thread::current());
   }
 
   if (load_addr != NULL && fwd != obj) {
     // Since we are here and we know the load address, update the reference.
     ShenandoahHeap::cas_oop(fwd, load_addr, obj);

@@ -148,22 +148,26 @@
 template <typename T>
 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap(T* addr) {
   oop value = Raw::oop_load_in_heap(addr);
   if (value != NULL) {
     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
-    value = bs->load_reference_barrier_not_null(value);
+    value = bs->load_reference_barrier_not_null(value, addr);
     bs->keep_alive_if_weak<decorators>(value);
   }
   return value;
 }
 
 template <DecoratorSet decorators, typename BarrierSetT>
 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_in_heap_at(oop base, ptrdiff_t offset) {
   oop value = Raw::oop_load_in_heap_at(base, offset);
   if (value != NULL) {
     ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set();
-    value = bs->load_reference_barrier_not_null(value);
+    if (UseCompressedOops) {
+      value = bs->load_reference_barrier_not_null(value, (narrowOop*)Raw::field_addr(base, offset));
+    } else {
+      value = bs->load_reference_barrier_not_null(value, (oop*)Raw::field_addr(base, offset));
+    }
     bs->keep_alive_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength<decorators>(base, offset),
                            value);
   }
   return value;
 }

@@ -208,11 +212,11 @@
   } while ((compare_value != expected) && (resolve_forwarded(compare_value) == resolve_forwarded(expected)));
 
   // Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
   // because it must be the previous value.
   if (res != NULL) {
-    res = ShenandoahBarrierSet::barrier_set()->load_reference_barrier_not_null(res);
+    res = ShenandoahBarrierSet::barrier_set()->load_reference_barrier_not_null(res, (oop*)NULL); // TODO: really NULL?
     bs->satb_enqueue(res);
   }
   return res;
 }
 

@@ -236,11 +240,11 @@
   oop previous = Raw::oop_atomic_xchg(addr, new_value);
 
   // Note: We don't need a keep-alive-barrier here. We already enqueue any loaded reference for SATB anyway,
   // because it must be the previous value.
   if (previous != NULL) {
-    previous = ShenandoahBarrierSet::barrier_set()->load_reference_barrier_not_null(previous);
+    previous = ShenandoahBarrierSet::barrier_set()->load_reference_barrier_not_null(previous, (oop*)NULL); // TODO: really NULL?
     bs->satb_enqueue(previous);
   }
   return previous;
 }
 

@@ -290,11 +294,11 @@
     if (!CompressedOops::is_null(o)) {
       oop obj = CompressedOops::decode_not_null(o);
       if (HAS_FWD && cset->is_in(obj)) {
         oop fwd = resolve_forwarded_not_null(obj);
         if (EVAC && obj == fwd) {
-          fwd = _heap->evacuate_object(obj, thread);
+          fwd = _heap->evacuate_object_recursively(obj, elem_ptr, thread);
         }
         assert(obj != fwd || _heap->cancelled_gc(), "must be forwarded");
         oop witness = ShenandoahHeap::cas_oop(fwd, elem_ptr, o);
         obj = fwd;
       }
< prev index next >