8225441: Cleanup ShenandoahHeap::atomic_compare_exchange_oop

Reviewed-by: rkennke
This commit is contained in:
Aleksey Shipilev 2019-06-07 11:48:01 +02:00
parent 46ba311bda
commit fdef3f9305
3 changed files with 7 additions and 7 deletions

View File

@ -690,8 +690,8 @@ public:
template <class T>
inline oop update_with_forwarded_not_null(T* p, oop obj);
inline oop atomic_compare_exchange_oop(oop n, narrowOop* addr, oop c);
inline oop atomic_compare_exchange_oop(oop n, oop* addr, oop c);
static inline oop cas_oop(oop n, narrowOop* addr, oop c);
static inline oop cas_oop(oop n, oop* addr, oop c);
void trash_humongous_region_at(ShenandoahHeapRegion *r);

View File

@ -116,7 +116,7 @@ inline oop ShenandoahHeap::evac_update_with_forwarded(T* p) {
if (oopDesc::equals_raw(forwarded_oop, heap_oop)) {
forwarded_oop = evacuate_object(heap_oop, Thread::current());
}
oop prev = atomic_compare_exchange_oop(forwarded_oop, p, heap_oop);
oop prev = cas_oop(forwarded_oop, p, heap_oop);
if (oopDesc::equals_raw(prev, heap_oop)) {
return forwarded_oop;
} else {
@ -129,11 +129,11 @@ inline oop ShenandoahHeap::evac_update_with_forwarded(T* p) {
}
}
inline oop ShenandoahHeap::atomic_compare_exchange_oop(oop n, oop* addr, oop c) {
inline oop ShenandoahHeap::cas_oop(oop n, oop* addr, oop c) {
return (oop) Atomic::cmpxchg(n, addr, c);
}
inline oop ShenandoahHeap::atomic_compare_exchange_oop(oop n, narrowOop* addr, oop c) {
inline oop ShenandoahHeap::cas_oop(oop n, narrowOop* addr, oop c) {
narrowOop cmp = CompressedOops::encode(c);
narrowOop val = CompressedOops::encode(n);
return CompressedOops::decode((narrowOop) Atomic::cmpxchg(val, addr, cmp));
@ -157,7 +157,7 @@ inline oop ShenandoahHeap::maybe_update_with_forwarded_not_null(T* p, oop heap_o
// If this fails, another thread wrote to p before us, it will be logged in SATB and the
// reference be updated later.
oop witness = atomic_compare_exchange_oop(forwarded_oop, p, heap_oop);
oop witness = cas_oop(forwarded_oop, p, heap_oop);
if (!oopDesc::equals_raw(witness, heap_oop)) {
// CAS failed, someone had beat us to it. Normally, we would return the failure witness,

View File

@ -54,7 +54,7 @@ void ShenandoahTraversalGC::process_oop(T* p, Thread* thread, ShenandoahObjToSca
}
shenandoah_assert_forwarded_except(p, obj, _heap->cancelled_gc());
// Update reference.
_heap->atomic_compare_exchange_oop(forw, p, obj);
ShenandoahHeap::cas_oop(forw, p, obj);
obj = forw;
}