[llvm-commits] [vmkit] r50411 - /vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Apr 29 01:51:35 PDT 2008
Author: geoffray
Date: Tue Apr 29 03:51:35 2008
New Revision: 50411
URL: http://llvm.org/viewvc/llvm-project?rev=50411&view=rev
Log:
Implementation of sun.misc.Unsafe::objectFieldOffset.
Modified:
vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp
Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp?rev=50411&r1=50410&r2=50411&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMField.cpp Tue Apr 29 03:51:35 2008
@@ -373,6 +373,14 @@
}
}
-
+JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_objectFieldOffset(
+#ifdef NATIVE_JNI
+JNIEnv *env,
+jclass clazz,
+#endif
+JavaObject* Field) {
+ JavaField* field = (JavaField*)((*Classpath::fieldSlot)((JavaObject*)Field).IntVal.getZExtValue());
+ return (jlong)field->ptrOffset;
+}
}
More information about the llvm-commits
mailing list