Skip to content
Permalink
Browse files

8242301: Shenandoah: Inline LRB runtime call

Reviewed-by: zgu
  • Loading branch information
rkennke committed Apr 7, 2020
1 parent 7ac64b8 commit 2b42382e7e78e80097c3f0ae5a2542571c33672f
@@ -125,35 +125,6 @@ oop ShenandoahBarrierSet::load_reference_barrier(oop obj) {
}
}

oop ShenandoahBarrierSet::load_reference_barrier_mutator(oop obj, oop* load_addr) {
return load_reference_barrier_mutator_work(obj, load_addr);
}

oop ShenandoahBarrierSet::load_reference_barrier_mutator(oop obj, narrowOop* load_addr) {
return load_reference_barrier_mutator_work(obj, load_addr);
}

template <class T>
oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_addr) {
assert(ShenandoahLoadRefBarrier, "should be enabled");
shenandoah_assert_in_cset(load_addr, obj);

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());
}

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);
}

return fwd;
}

oop ShenandoahBarrierSet::load_reference_barrier_impl(oop obj) {
assert(ShenandoahLoadRefBarrier, "should be enabled");
if (!CompressedOops::is_null(obj)) {
@@ -96,11 +96,8 @@ class ShenandoahBarrierSet: public BarrierSet {
oop load_reference_barrier(oop obj);
oop load_reference_barrier_not_null(oop obj);

oop load_reference_barrier_mutator(oop obj, oop* load_addr);
oop load_reference_barrier_mutator(oop obj, narrowOop* load_addr);

template <class T>
oop load_reference_barrier_mutator_work(oop obj, T* load_addr);
inline oop load_reference_barrier_mutator(oop obj, T* load_addr);

oop load_reference_barrier_native(oop obj, oop* load_addr);
oop load_reference_barrier_native(oop obj, narrowOop* load_addr);
@@ -53,6 +53,27 @@ inline oop ShenandoahBarrierSet::resolve_forwarded_not_null_mutator(oop p) {
return ShenandoahForwarding::get_forwardee_mutator(p);
}

template <class T>
inline oop ShenandoahBarrierSet::load_reference_barrier_mutator(oop obj, T* load_addr) {
assert(ShenandoahLoadRefBarrier, "should be enabled");
shenandoah_assert_in_cset(load_addr, obj);

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());
}

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);
}

return fwd;
}

inline void ShenandoahBarrierSet::enqueue(oop obj) {
assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");

0 comments on commit 2b42382

Please sign in to comment.