mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
move Unsafe.putObjectVolatile and putOrderedObject implementations
This makes them available to all class libraries, not just OpenJDK.
This commit is contained in:
parent
cc5b58725a
commit
789c36a459
@ -60,6 +60,10 @@ public final class Unsafe {
|
||||
|
||||
public native void putObject(Object o, long offset, Object x);
|
||||
|
||||
public native void putObjectVolatile(Object o, long offset, Object x);
|
||||
|
||||
public native void putOrderedObject(Object o, long offset, Object x);
|
||||
|
||||
public native long getAddress(long address);
|
||||
|
||||
public native void putAddress(long address, long x);
|
||||
|
@ -703,6 +703,26 @@ Avian_sun_misc_Unsafe_putObject
|
||||
set(t, o, offset, reinterpret_cast<object>(value));
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT void JNICALL
|
||||
Avian_sun_misc_Unsafe_putObjectVolatile
|
||||
(Thread* t, object, uintptr_t* arguments)
|
||||
{
|
||||
object o = reinterpret_cast<object>(arguments[1]);
|
||||
int64_t offset; memcpy(&offset, arguments + 2, 8);
|
||||
object value = reinterpret_cast<object>(arguments[4]);
|
||||
|
||||
storeStoreMemoryBarrier();
|
||||
set(t, o, offset, reinterpret_cast<object>(value));
|
||||
storeLoadMemoryBarrier();
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT void JNICALL
|
||||
Avian_sun_misc_Unsafe_putOrderedObject
|
||||
(Thread* t, object method, uintptr_t* arguments)
|
||||
{
|
||||
Avian_sun_misc_Unsafe_putObjectVolatile(t, method, arguments);
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||
Avian_sun_misc_Unsafe_compareAndSwapObject
|
||||
(Thread* t, object, uintptr_t* arguments)
|
||||
|
@ -2794,26 +2794,6 @@ Avian_sun_misc_Unsafe_getObjectVolatile
|
||||
return value;
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT void JNICALL
|
||||
Avian_sun_misc_Unsafe_putObjectVolatile
|
||||
(Thread* t, object, uintptr_t* arguments)
|
||||
{
|
||||
object o = reinterpret_cast<object>(arguments[1]);
|
||||
int64_t offset; memcpy(&offset, arguments + 2, 8);
|
||||
object value = reinterpret_cast<object>(arguments[4]);
|
||||
|
||||
storeStoreMemoryBarrier();
|
||||
set(t, o, offset, reinterpret_cast<object>(value));
|
||||
storeLoadMemoryBarrier();
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT void JNICALL
|
||||
Avian_sun_misc_Unsafe_putOrderedObject
|
||||
(Thread* t, object method, uintptr_t* arguments)
|
||||
{
|
||||
Avian_sun_misc_Unsafe_putObjectVolatile(t, method, arguments);
|
||||
}
|
||||
|
||||
extern "C" AVIAN_EXPORT int64_t JNICALL
|
||||
Avian_sun_misc_Unsafe_pageSize
|
||||
(Thread*, object, uintptr_t*)
|
||||
|
Loading…
Reference in New Issue
Block a user