Atomic op cleanup.
Replaced VM-local macros for barrier and CAS calls with the actual
versions provided by cutils.
ATOMIC_CMP_SWAP(addr,old,new) --> android_atomic_release_cas(old,new,addr)
MEM_BARRIER --> ANDROID_MEMBAR_FULL
Renamed android_quasiatomic* to dvmQuasiAtomic*.
Didn't change how anything works, just the names.
Change-Id: I8c68f28e1f7c9cb832183e0918d097dfe6a2cac8
diff --git a/vm/native/sun_misc_Unsafe.c b/vm/native/sun_misc_Unsafe.c
index b1f3e83..5294368 100644
--- a/vm/native/sun_misc_Unsafe.c
+++ b/vm/native/sun_misc_Unsafe.c
@@ -106,7 +106,7 @@
// Note: android_atomic_cmpxchg() returns 0 on success, not failure.
int result =
- android_quasiatomic_cmpxchg_64(expectedValue, newValue, address);
+ dvmQuasiAtomicCas64(expectedValue, newValue, address);
RETURN_BOOLEAN(result == 0);
}
@@ -173,7 +173,7 @@
s8 offset = GET_ARG_LONG(args, 2);
volatile s8* address = (volatile s8*) (((u1*) obj) + offset);
- RETURN_LONG(android_quasiatomic_read_64(address));
+ RETURN_LONG(dvmQuasiAtomicRead64(address));
}
/*
@@ -188,7 +188,7 @@
s8 value = GET_ARG_LONG(args, 4);
volatile s8* address = (volatile s8*) (((u1*) obj) + offset);
- android_quasiatomic_swap_64(value, address);
+ dvmQuasiAtomicSwap64(value, address);
RETURN_VOID();
}