8242301: Shenandoah: Inline LRB runtime call

Reviewed-by: zgu
This commit is contained in:
Roman Kennke 2020-04-07 22:31:18 +02:00
parent a23638bef5
commit ceab1d8e69
3 changed files with 22 additions and 34 deletions

View File

@ -124,36 +124,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)) {

View File

@ -95,11 +95,8 @@ public:
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);

View File

@ -52,6 +52,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");