From 708519d8126d4932da0ccdb4b6fc53e49e6f5d83 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 3 Jan 2014 11:13:21 -0700 Subject: [PATCH] implement Unsafe.objectFieldOffset for the Avian class library --- src/classpath-avian.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/classpath-avian.cpp b/src/classpath-avian.cpp index b878e04006..dbbf821828 100644 --- a/src/classpath-avian.cpp +++ b/src/classpath-avian.cpp @@ -729,6 +729,14 @@ Avian_avian_Atomic_getOffset (t, jfieldVmField(t, reinterpret_cast(arguments[0]))); } +extern "C" AVIAN_EXPORT int64_t JNICALL +Avian_sun_misc_Unsafe_objectFieldOffset +(Thread* t, object, uintptr_t* arguments) +{ + return fieldOffset + (t, jfieldVmField(t, reinterpret_cast(arguments[1]))); +} + extern "C" AVIAN_EXPORT int64_t JNICALL Avian_avian_Atomic_compareAndSwapObject (Thread* t, object, uintptr_t* arguments)