* src/native/llni.h: Added LLNI (low level native interface).
authormichi <none@none>
Fri, 10 Aug 2007 08:58:39 +0000 (08:58 +0000)
committermichi <none@none>
Fri, 10 Aug 2007 08:58:39 +0000 (08:58 +0000)
Use LLNI macros throughout the whole codebase:
* src/vm/jit/stacktrace.c
* src/vm/string.c
* src/vm/builtin.c
* src/vm/exceptions.c
* src/vm/vm.c
* src/native/jni.c
* src/native/vm/java_lang_ClassLoader.c
* src/native/vm/java_lang_Class.c
* src/native/vm/java_lang_String.c
* src/native/vm/java_lang_Object.c
* src/native/vm/gnu/java_lang_VMThread.c
* src/native/vm/gnu/java_lang_reflect_Method.c
* src/native/vm/gnu/java_lang_reflect_Field.c
* src/native/vm/gnu/java_lang_reflect_Constructor.c
* src/native/vm/gnu/java_lang_VMThrowable.c
* src/native/vm/java_lang_Thread.c
* src/native/vm/sun_misc_Unsafe.c
* src/native/vm/reflect.c
* src/native/vm/java_lang_reflect_Method.c
* src/native/vm/java_lang_reflect_Constructor.c
* src/threads/threads-common.c
* src/threads/native/threads.c

23 files changed:
src/native/jni.c
src/native/llni.h [new file with mode: 0644]
src/native/vm/gnu/java_lang_VMThread.c
src/native/vm/gnu/java_lang_VMThrowable.c
src/native/vm/gnu/java_lang_reflect_Constructor.c
src/native/vm/gnu/java_lang_reflect_Field.c
src/native/vm/gnu/java_lang_reflect_Method.c
src/native/vm/java_lang_Class.c
src/native/vm/java_lang_ClassLoader.c
src/native/vm/java_lang_Object.c
src/native/vm/java_lang_String.c
src/native/vm/java_lang_Thread.c
src/native/vm/java_lang_reflect_Constructor.c
src/native/vm/java_lang_reflect_Method.c
src/native/vm/reflect.c
src/native/vm/sun_misc_Unsafe.c
src/threads/native/threads.c
src/threads/threads-common.c
src/vm/builtin.c
src/vm/exceptions.c
src/vm/jit/stacktrace.c
src/vm/string.c
src/vm/vm.c

index 1d6014847b55b787f30c561c1fce238c7c84be34..3a257d339a2d51b6bb657a93ce79fca7d9d2ee01 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jni.c 8270 2007-08-08 13:57:12Z twisti $
+   $Id: jni.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -38,6 +38,7 @@
 #include "mm/gc-common.h"
 #include "mm/memory.h"
 #include "native/jni.h"
 #include "mm/gc-common.h"
 #include "mm/memory.h"
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #if defined(ENABLE_JAVASE)
 #include "native/native.h"
 
 #if defined(ENABLE_JAVASE)
@@ -898,7 +899,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                bo = (java_lang_Boolean *) ro;
                /* setting the value of the object direct */
 
                bo = (java_lang_Boolean *) ro;
-               bo->value = i;
+               LLNI_field_set_val(bo, value, i);
        }
        break;
 
        }
        break;
 
@@ -913,7 +914,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                bo = (java_lang_Byte *) ro;
                /* setting the value of the object direct */
 
                bo = (java_lang_Byte *) ro;
-               bo->value = i;
+               LLNI_field_set_val(bo, value, i);
        }
        break;
 
        }
        break;
 
@@ -928,7 +929,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                co = (java_lang_Character *) ro;
                /* setting the value of the object direct */
 
                co = (java_lang_Character *) ro;
-               co->value = i;
+               LLNI_field_set_val(co, value, i);
        }
        break;
 
        }
        break;
 
@@ -943,7 +944,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                so = (java_lang_Short *) ro;
                /* setting the value of the object direct */
 
                so = (java_lang_Short *) ro;
-               so->value = i;
+               LLNI_field_set_val(so, value, i);
        }
        break;
 
        }
        break;
 
@@ -958,7 +959,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                io = (java_lang_Integer *) ro;
                /* setting the value of the object direct */
 
                io = (java_lang_Integer *) ro;
-               io->value = i;
+               LLNI_field_set_val(io, value, i);
        }
        break;
 
        }
        break;
 
@@ -973,7 +974,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                lo = (java_lang_Long *) ro;
                /* setting the value of the object direct */
 
                lo = (java_lang_Long *) ro;
-               lo->value = l;
+               LLNI_field_set_val(lo, value, l);
        }
        break;
 
        }
        break;
 
@@ -988,7 +989,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                fo = (java_lang_Float *) ro;
                /* setting the value of the object direct */
 
                fo = (java_lang_Float *) ro;
-               fo->value = f;
+               LLNI_field_set_val(fo, value, f);
        }
        break;
 
        }
        break;
 
@@ -1003,7 +1004,7 @@ java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                /* setting the value of the object direct */
 
                _do = (java_lang_Double *) ro;
                /* setting the value of the object direct */
 
                _do = (java_lang_Double *) ro;
-               _do->value = d;
+               LLNI_field_set_val(_do, value, d);
        }
        break;
 
        }
        break;
 
@@ -1803,15 +1804,15 @@ jmethodID _Jv_JNI_FromReflectedMethod(JNIEnv *env, jobject method)
                java_lang_reflect_Method *rm;
 
                rm   = (java_lang_reflect_Method *) method;
                java_lang_reflect_Method *rm;
 
                rm   = (java_lang_reflect_Method *) method;
-               c    = (classinfo *) (rm->clazz);
-               slot = rm->slot;
+               LLNI_field_get_cls(rm, clazz, c);
+               LLNI_field_get_val(rm, slot , slot);
        }
        else if (builtin_instanceof(o, class_java_lang_reflect_Constructor)) {
                java_lang_reflect_Constructor *rc;
 
                rc   = (java_lang_reflect_Constructor *) method;
        }
        else if (builtin_instanceof(o, class_java_lang_reflect_Constructor)) {
                java_lang_reflect_Constructor *rc;
 
                rc   = (java_lang_reflect_Constructor *) method;
-               c    = (classinfo *) (rc->clazz);
-               slot = rc->slot;
+               LLNI_field_get_cls(rc, clazz, c);
+               LLNI_field_get_val(rc, slot , slot);
        }
        else
                return NULL;
        }
        else
                return NULL;
@@ -1841,6 +1842,7 @@ jfieldID _Jv_JNI_FromReflectedField(JNIEnv* env, jobject field)
        java_lang_reflect_Field *rf;
        classinfo               *c;
        fieldinfo               *f;
        java_lang_reflect_Field *rf;
        classinfo               *c;
        fieldinfo               *f;
+       int32_t                  slot
 
        STATISTICS(jniinvokation());
 
 
        STATISTICS(jniinvokation());
 
@@ -1849,8 +1851,9 @@ jfieldID _Jv_JNI_FromReflectedField(JNIEnv* env, jobject field)
        if (rf == NULL)
                return NULL;
 
        if (rf == NULL)
                return NULL;
 
-       c = (classinfo *) rf->clazz;
-       f = &(c->fields[rf->slot]);
+       LLNI_field_get_cls(rf, clazz, c);
+       LLNI_field_get_val(rf, slot , slot);
+       f = &(c->fields[slot]);
 
        return (jfieldID) f;
 #else
 
        return (jfieldID) f;
 #else
@@ -4080,9 +4083,9 @@ jstring _Jv_JNI_NewString(JNIEnv *env, const jchar *buf, jsize len)
        for (i = 0; i < len; i++)
                a->data[i] = buf[i];
 
        for (i = 0; i < len; i++)
                a->data[i] = buf[i];
 
-       s->value  = a;
-       s->offset = 0;
-       s->count  = len;
+       LLNI_field_set_ref(s, value , a);
+       LLNI_field_set_val(s, offset, 0);
+       LLNI_field_set_val(s, count , len);
 
        return (jstring) _Jv_JNI_NewLocalRef(env, (jobject) s);
 }
 
        return (jstring) _Jv_JNI_NewLocalRef(env, (jobject) s);
 }
@@ -4100,12 +4103,15 @@ static jchar emptyStringJ[]={0,0};
 jsize _Jv_JNI_GetStringLength(JNIEnv *env, jstring str)
 {
        java_lang_String *s;
 jsize _Jv_JNI_GetStringLength(JNIEnv *env, jstring str)
 {
        java_lang_String *s;
+       jsize             len;
 
        TRACEJNICALLS("_Jv_JNI_GetStringLength(env=%p, str=%p)", env, str);
 
        s = (java_lang_String *) str;
 
 
        TRACEJNICALLS("_Jv_JNI_GetStringLength(env=%p, str=%p)", env, str);
 
        s = (java_lang_String *) str;
 
-       return s->count;
+       LLNI_field_get_val(s, count, len);
+
+       return len;
 }
 
 
 }
 
 
@@ -4125,19 +4131,19 @@ u2 *javastring_tou2(jstring so)
        if (!s)
                return NULL;
 
        if (!s)
                return NULL;
 
-       a = s->value;
+       LLNI_field_get_ref(s, value, a);
 
        if (!a)
                return NULL;
 
        /* allocate memory */
 
 
        if (!a)
                return NULL;
 
        /* allocate memory */
 
-       stringbuffer = MNEW(u2, s->count + 1);
+       stringbuffer = MNEW(u2, LLNI_field_direct(s, count) + 1);
 
        /* copy text */
 
 
        /* copy text */
 
-       for (i = 0; i < s->count; i++)
-               stringbuffer[i] = a->data[s->offset + i];
+       for (i = 0; i < LLNI_field_direct(s, count); i++)
+               stringbuffer[i] = a->data[LLNI_field_direct(s, offset) + i];
        
        /* terminate string */
 
        
        /* terminate string */
 
@@ -4186,12 +4192,16 @@ const jchar *_Jv_JNI_GetStringChars(JNIEnv *env, jstring str, jboolean *isCopy)
 
 void _Jv_JNI_ReleaseStringChars(JNIEnv *env, jstring str, const jchar *chars)
 {
 
 void _Jv_JNI_ReleaseStringChars(JNIEnv *env, jstring str, const jchar *chars)
 {
+       java_lang_String *s;
+
        STATISTICS(jniinvokation());
 
        if (chars == emptyStringJ)
                return;
 
        STATISTICS(jniinvokation());
 
        if (chars == emptyStringJ)
                return;
 
-       MFREE(((jchar *) chars), jchar, ((java_lang_String *) str)->count + 1);
+       s = (java_lang_String *) str;
+
+       MFREE(((jchar *) chars), jchar, LLNI_field_direct(s, count) + 1);
 }
 
 
 }
 
 
@@ -4225,7 +4235,7 @@ jsize _Jv_JNI_GetStringUTFLength(JNIEnv *env, jstring string)
 
        s = (java_lang_String *) string;
 
 
        s = (java_lang_String *) string;
 
-    length = u2_utflength(s->value->data, s->count);
+    length = u2_utflength(LLNI_field_direct(s, value)->data, LLNI_field_direct(s, count));
 
        return length;
 }
 
        return length;
 }
@@ -5292,10 +5302,10 @@ void _Jv_JNI_GetStringRegion(JNIEnv* env, jstring str, jsize start, jsize len,
        STATISTICS(jniinvokation());
 
        s  = (java_lang_String *) str;
        STATISTICS(jniinvokation());
 
        s  = (java_lang_String *) str;
-       ca = s->value;
+       LLNI_field_get_ref(s, value, ca);
 
 
-       if ((start < 0) || (len < 0) || (start > s->count) ||
-               (start + len > s->count)) {
+       if ((start < 0) || (len < 0) || (start > LLNI_field_direct(s, count)) ||
+               (start + len > LLNI_field_direct(s, count))) {
                exceptions_throw_stringindexoutofboundsexception();
                return;
        }
                exceptions_throw_stringindexoutofboundsexception();
                return;
        }
@@ -5324,16 +5334,16 @@ void _Jv_JNI_GetStringUTFRegion(JNIEnv* env, jstring str, jsize start,
        TRACEJNICALLS("_Jv_JNI_GetStringUTFRegion(env=%p, str=%p, start=%d, len=%d, buf=%p)", env, str, start, len, buf);
 
        s  = (java_lang_String *) str;
        TRACEJNICALLS("_Jv_JNI_GetStringUTFRegion(env=%p, str=%p, start=%d, len=%d, buf=%p)", env, str, start, len, buf);
 
        s  = (java_lang_String *) str;
-       ca = s->value;
+       LLNI_field_get_ref(s, value, ca);
 
 
-       if ((start < 0) || (len < 0) || (start > s->count) ||
-               (start + len > s->count)) {
+       if ((start < 0) || (len < 0) || (start > LLNI_field_direct(s, count)) ||
+               (start + len > LLNI_field_direct(s, count))) {
                exceptions_throw_stringindexoutofboundsexception();
                return;
        }
 
        for (i = 0; i < len; i++)
                exceptions_throw_stringindexoutofboundsexception();
                return;
        }
 
        for (i = 0; i < len; i++)
-               buf[i] = ca->data[s->offset + start + i];
+               buf[i] = ca->data[LLNI_field_direct(s, offset) + start + i];
 
        buf[i] = '\0';
 }
 
        buf[i] = '\0';
 }
@@ -5608,7 +5618,7 @@ jobject _Jv_JNI_NewDirectByteBuffer(JNIEnv *env, void *address, jlong capacity)
 
        /* fill gnu.classpath.Pointer{32,64} with address */
 
 
        /* fill gnu.classpath.Pointer{32,64} with address */
 
-       paddress->data = (ptrint) address;
+       LLNI_field_set_val(paddress, data, (ptrint) address);
 
        /* create a java.nio.DirectByteBufferImpl$ReadWrite object */
 
 
        /* create a java.nio.DirectByteBufferImpl$ReadWrite object */
 
@@ -5641,10 +5651,11 @@ void *_Jv_JNI_GetDirectBufferAddress(JNIEnv *env, jobject buf)
 #if defined(ENABLE_JAVASE) && defined(WITH_CLASSPATH_GNU)
        java_nio_DirectByteBufferImpl *nbuf;
 # if SIZEOF_VOID_P == 8
 #if defined(ENABLE_JAVASE) && defined(WITH_CLASSPATH_GNU)
        java_nio_DirectByteBufferImpl *nbuf;
 # if SIZEOF_VOID_P == 8
-       gnu_classpath_Pointer64       *address;
+       gnu_classpath_Pointer64       *paddress;
 # else
 # else
-       gnu_classpath_Pointer32       *address;
+       gnu_classpath_Pointer32       *paddress;
 # endif
 # endif
+       void                          *address;
 
        STATISTICS(jniinvokation());
 
 
        STATISTICS(jniinvokation());
 
@@ -5654,15 +5665,20 @@ void *_Jv_JNI_GetDirectBufferAddress(JNIEnv *env, jobject buf)
        nbuf = (java_nio_DirectByteBufferImpl *) buf;
 
 # if SIZEOF_VOID_P == 8
        nbuf = (java_nio_DirectByteBufferImpl *) buf;
 
 # if SIZEOF_VOID_P == 8
-       address = (gnu_classpath_Pointer64 *) nbuf->address;
+       LLNI_field_get_ref(nbuf, address, paddress);
+       /* this was the cast to avaoid warning: (gnu_classpath_Pointer64 *) nbuf->address; */
 # else
 # else
-       address = (gnu_classpath_Pointer32 *) nbuf->address;
+       LLNI_field_get_ref(nbuf, address, paddress); 
+       /* this was the cast to avaoid warning: (gnu_classpath_Pointer32 *) nbuf->address; */
 # endif
 
 # endif
 
-       if (address == NULL)
+       if (paddress == NULL)
                return NULL;
 
                return NULL;
 
-       return (void *) address->data;
+       LLNI_field_get_val(paddress, data, address);
+       /* this was the cast to avaoid warning: (void *) paddress->data */
+
+       return address;
 #else
        vm_abort("_Jv_JNI_GetDirectBufferAddress: not implemented in this configuration");
 
 #else
        vm_abort("_Jv_JNI_GetDirectBufferAddress: not implemented in this configuration");
 
@@ -5685,6 +5701,7 @@ jlong _Jv_JNI_GetDirectBufferCapacity(JNIEnv* env, jobject buf)
 #if defined(ENABLE_JAVASE) && defined(WITH_CLASSPATH_GNU)
        java_objectheader *o;
        java_nio_Buffer   *nbuf;
 #if defined(ENABLE_JAVASE) && defined(WITH_CLASSPATH_GNU)
        java_objectheader *o;
        java_nio_Buffer   *nbuf;
+       jlong              capacity;
 
        STATISTICS(jniinvokation());
 
 
        STATISTICS(jniinvokation());
 
@@ -5695,7 +5712,9 @@ jlong _Jv_JNI_GetDirectBufferCapacity(JNIEnv* env, jobject buf)
 
        nbuf = (java_nio_Buffer *) o;
 
 
        nbuf = (java_nio_Buffer *) o;
 
-       return (jlong) nbuf->cap;
+       LLNI_field_get_val(nbuf, cap, capacity);
+
+       return capacity;
 #else
        vm_abort("_Jv_JNI_GetDirectBufferCapacity: not implemented in this configuration");
 
 #else
        vm_abort("_Jv_JNI_GetDirectBufferCapacity: not implemented in this configuration");
 
diff --git a/src/native/llni.h b/src/native/llni.h
new file mode 100644 (file)
index 0000000..153c291
--- /dev/null
@@ -0,0 +1,94 @@
+/* src/native/llni.h - low level native interfarce (LLNI) macros
+
+   Copyright (C) 2007 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   $Id$
+
+*/
+
+
+#ifndef _LLNI_H
+#define _LLNI_H
+
+#include "config.h"
+
+
+/* LLNI macros *****************************************************************
+
+   The following macros should be used whenever a Java Object is
+   accessed in native code without the use of an JNI function.
+
+   LLNI_field_set_val, LLNI_field_get_val:
+     Deal with primitive values like integer and float values. Do
+     not use these macros to access pointers or references!
+
+   LLNI_field_set_ref, LLNI_field_get_ref:
+     Deal with references to other objects.
+
+   LLNI_field_set_cls, LLNI_field_get_cls:
+     Deal with references to Java Classes which are internally
+     represented by classinfo or java_lang_Class.
+
+*******************************************************************************/
+
+#define LLNI_field_set_val(obj, field, value) \
+       LLNI_field_direct(obj, field) = (value)
+
+#define LLNI_field_set_ref(obj, field, reference) \
+       LLNI_field_set_val(obj, field, reference)
+
+#define LLNI_field_set_cls(obj, field, value) \
+       LLNI_field_direct(obj, field) = (java_lang_Class *) (value)
+
+#define LLNI_field_get_val(obj, field, variable) \
+       (variable) = LLNI_field_direct(obj, field)
+
+#define LLNI_field_get_ref(obj, field, variable) \
+       LLNI_field_get_val(obj, field, variable)
+
+#define LLNI_field_get_cls(obj, field, variable) \
+       (variable) = (classinfo *) LLNI_field_direct(obj, field)
+
+#define LLNI_class_get(obj, variable) \
+       (variable) = LLNI_field_direct(obj, header.vftbl->class)
+
+/* XXX the direct macros have to be used inside a critical section!!! */
+
+#define LLNI_field_direct(obj, field) ((obj)->field) 
+
+
+#endif /* _LLNI_H */
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
index 124c41f0edad5cb8e2c4d69401a4752afe22a5ef..4ce14308d2f3bc5ace479b48c51cc28e7c9dc6b1 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_VMThread.c 8123 2007-06-20 23:50:55Z michi $
+   $Id: java_lang_VMThread.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -32,6 +32,7 @@
 #include <stdint.h>
 
 #include "native/jni.h"
 #include <stdint.h>
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_ThreadGroup.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_ThreadGroup.h"
@@ -91,7 +92,11 @@ void _Jv_java_lang_VMThread_init(void)
  */
 JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_countStackFrames(JNIEnv *env, java_lang_VMThread *this)
 {
  */
 JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_countStackFrames(JNIEnv *env, java_lang_VMThread *this)
 {
-    return _Jv_java_lang_Thread_countStackFrames(this->thread);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       return _Jv_java_lang_Thread_countStackFrames(thread);
 }
 
 
 }
 
 
@@ -102,7 +107,11 @@ JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_countStackFrames(JNIEnv *env,
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_start(JNIEnv *env, java_lang_VMThread *this, int64_t stacksize)
 {
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_start(JNIEnv *env, java_lang_VMThread *this, int64_t stacksize)
 {
-       _Jv_java_lang_Thread_start(this->thread, stacksize);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       _Jv_java_lang_Thread_start(thread, stacksize);
 }
 
 
 }
 
 
@@ -113,7 +122,11 @@ JNIEXPORT void JNICALL Java_java_lang_VMThread_start(JNIEnv *env, java_lang_VMTh
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_interrupt(JNIEnv *env, java_lang_VMThread *this)
 {
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_interrupt(JNIEnv *env, java_lang_VMThread *this)
 {
-       _Jv_java_lang_Thread_interrupt(this->thread);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       _Jv_java_lang_Thread_interrupt(thread);
 }
 
 
 }
 
 
@@ -124,7 +137,11 @@ JNIEXPORT void JNICALL Java_java_lang_VMThread_interrupt(JNIEnv *env, java_lang_
  */
 JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_isInterrupted(JNIEnv *env, java_lang_VMThread *this)
 {
  */
 JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_isInterrupted(JNIEnv *env, java_lang_VMThread *this)
 {
-       return _Jv_java_lang_Thread_isInterrupted(this->thread);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       return _Jv_java_lang_Thread_isInterrupted(thread);
 }
 
 
 }
 
 
@@ -135,7 +152,11 @@ JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_isInterrupted(JNIEnv *env, jav
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_suspend(JNIEnv *env, java_lang_VMThread *this)
 {
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_suspend(JNIEnv *env, java_lang_VMThread *this)
 {
-       _Jv_java_lang_Thread_suspend(this->thread);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       _Jv_java_lang_Thread_suspend(thread);
 }
 
 
 }
 
 
@@ -146,7 +167,11 @@ JNIEXPORT void JNICALL Java_java_lang_VMThread_suspend(JNIEnv *env, java_lang_VM
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_resume(JNIEnv *env, java_lang_VMThread *this)
 {
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_resume(JNIEnv *env, java_lang_VMThread *this)
 {
-       _Jv_java_lang_Thread_resume(this->thread);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       _Jv_java_lang_Thread_resume(thread);
 }
 
 
 }
 
 
@@ -157,7 +182,11 @@ JNIEXPORT void JNICALL Java_java_lang_VMThread_resume(JNIEnv *env, java_lang_VMT
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeSetPriority(JNIEnv *env, java_lang_VMThread *this, int32_t priority)
 {
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeSetPriority(JNIEnv *env, java_lang_VMThread *this, int32_t priority)
 {
-       _Jv_java_lang_Thread_setPriority(this->thread, priority);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       _Jv_java_lang_Thread_setPriority(thread, priority);
 }
 
 
 }
 
 
@@ -168,7 +197,11 @@ JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeSetPriority(JNIEnv *env, ja
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeStop(JNIEnv *env, java_lang_VMThread *this, java_lang_Throwable *t)
 {
  */
 JNIEXPORT void JNICALL Java_java_lang_VMThread_nativeStop(JNIEnv *env, java_lang_VMThread *this, java_lang_Throwable *t)
 {
-       _Jv_java_lang_Thread_stop(this->thread, t);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       _Jv_java_lang_Thread_stop(thread, t);
 }
 
 
 }
 
 
@@ -223,7 +256,11 @@ JNIEXPORT int32_t JNICALL Java_java_lang_VMThread_holdsLock(JNIEnv *env, jclass
  */
 JNIEXPORT java_lang_String* JNICALL Java_java_lang_VMThread_getState(JNIEnv *env, java_lang_VMThread *this)
 {
  */
 JNIEXPORT java_lang_String* JNICALL Java_java_lang_VMThread_getState(JNIEnv *env, java_lang_VMThread *this)
 {
-       return _Jv_java_lang_Thread_getState(this->thread);
+       java_lang_Thread *thread;
+
+       LLNI_field_get_ref(this, thread, thread);
+
+       return _Jv_java_lang_Thread_getState(thread);
 }
 
 
 }
 
 
index feb5fa25a36b870b168257d4a98f4492499a3f8b..5830c0b4e743882a7d4f6d5407fe820301588ebe 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_VMThrowable.c 7910 2007-05-16 08:02:52Z twisti $
+   $Id: java_lang_VMThrowable.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -34,6 +34,7 @@
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/gnu_classpath_Pointer.h"
 #include "native/native.h"
 
 #include "native/include/gnu_classpath_Pointer.h"
@@ -100,7 +101,7 @@ JNIEXPORT java_lang_VMThrowable* JNICALL Java_java_lang_VMThrowable_fillInStackT
        if (stc == NULL)
                return NULL;
 
        if (stc == NULL)
                return NULL;
 
-       o->vmData = (gnu_classpath_Pointer *) stc;
+       LLNI_field_set_ref(o, vmData, (gnu_classpath_Pointer *) stc);
 
        return o;
 }
 
        return o;
 }
@@ -133,12 +134,13 @@ JNIEXPORT java_objectarray* JNICALL Java_java_lang_VMThrowable_getStackTrace(JNI
 
        /* get the stacktrace buffer from the VMThrowable object */
 
 
        /* get the stacktrace buffer from the VMThrowable object */
 
-       stc = (stacktracecontainer *) this->vmData;
+       /*XXX stc = (stacktracecontainer *) this->vmData;*/
+       LLNI_field_get_ref(this, vmData, stc);
        stb = &(stc->stb);
 
        /* get the class of the Throwable object */
 
        stb = &(stc->stb);
 
        /* get the class of the Throwable object */
 
-       c = t->header.vftbl->class;
+       LLNI_class_get(t, c);
 
        assert(stb != NULL);
 
 
        assert(stb != NULL);
 
@@ -255,11 +257,11 @@ JNIEXPORT java_objectarray* JNICALL Java_java_lang_VMThrowable_getStackTrace(JNI
 
                /* fill the java.lang.StackTraceElement element */
 
 
                /* fill the java.lang.StackTraceElement element */
 
-               o->fileName       = filename;
-               o->lineNumber     = linenumber;
-               o->declaringClass = declaringclass;
-               o->methodName     = (java_lang_String *) javastring_new(ste->method->name);
-               o->isNative       = (ste->method->flags & ACC_NATIVE) ? 1 : 0;
+               LLNI_field_set_ref(o, fileName      , filename);
+               LLNI_field_set_val(o, lineNumber    , linenumber);
+               LLNI_field_set_ref(o, declaringClass, declaringclass);
+               LLNI_field_set_ref(o, methodName    , (java_lang_String *) javastring_new(ste->method->name));
+               LLNI_field_set_val(o, isNative      , (ste->method->flags & ACC_NATIVE) ? 1 : 0);
 
                oa->data[i] = (java_objectheader *) o;
        }
 
                oa->data[i] = (java_objectheader *) o;
        }
index 8592d8b4842be5600ce490edc26ca8e795036cbb..8790e35e8e87e1de53af054e2c524ef0cd6aa304 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Constructor.c 8262 2007-08-06 12:44:01Z panzi $
+   $Id: java_lang_reflect_Constructor.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
 #include <assert.h>
 #include <stdlib.h>
 
 #include <assert.h>
 #include <stdlib.h>
 
-#if defined(ENABLE_ANNOTATIONS)
-#include "vm/vm.h"
-#endif
-
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Class.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Class.h"
 #include "native/include/java_lang_String.h"
 #include "native/include/java_lang_reflect_Constructor.h"
 
 #include "native/include/java_lang_String.h"
 #include "native/include/java_lang_reflect_Constructor.h"
 
-#if defined(ENABLE_ANNOTATIONS)
-#include "native/include/sun_reflect_ConstantPool.h"
-#include "native/vm/reflect.h"
-#endif
-
 #include "native/vm/java_lang_reflect_Constructor.h"
 
 #include "vmcore/utf8.h"
 #include "native/vm/java_lang_reflect_Constructor.h"
 
 #include "vmcore/utf8.h"
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "getModifiersInternal",    "()I",                                                       (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getModifiers        },
-       { "getParameterTypes",       "()[Ljava/lang/Class;",                                      (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getParameterTypes   },
-       { "getExceptionTypes",       "()[Ljava/lang/Class;",                                      (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getExceptionTypes   },
-       { "constructNative",         "([Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object;", (void *) (ptrint) &Java_java_lang_reflect_Constructor_constructNative    },
-       { "getSignature",            "()Ljava/lang/String;",                                      (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getSignature        },
-#if defined(ENABLE_ANNOTATIONS)
-       { "declaredAnnotations",     "()Ljava/util/Map;",                                         (void *) (ptrint) &Java_java_lang_reflect_Constructor_declaredAnnotations     },
-       { "getParameterAnnotations", "()[[Ljava/lang/annotation/Annotation;",                     (void *) (ptrint) &Java_java_lang_reflect_Constructor_getParameterAnnotations },
-#endif
+       { "getModifiersInternal", "()I",                                                       (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getModifiers      },
+       { "getParameterTypes",    "()[Ljava/lang/Class;",                                      (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getParameterTypes },
+       { "getExceptionTypes",    "()[Ljava/lang/Class;",                                      (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getExceptionTypes },
+       { "constructNative",      "([Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object;", (void *) (ptrint) &Java_java_lang_reflect_Constructor_constructNative  },
+       { "getSignature",         "()Ljava/lang/String;",                                      (void *) (ptrint) &_Jv_java_lang_reflect_Constructor_getSignature      },
 };
 
 
 };
 
 
@@ -96,50 +84,13 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Constructor_construct
 {
        /* just to be sure */
 
 {
        /* just to be sure */
 
-       assert(this->clazz == declaringClass);
-       assert(this->slot  == slot);
+       assert(LLNI_field_direct(this, clazz) == declaringClass);
+       assert(LLNI_field_direct(this, slot)  == slot);
 
        return _Jv_java_lang_reflect_Constructor_newInstance(env, this, args);
 }
 
 
 
        return _Jv_java_lang_reflect_Constructor_newInstance(env, this, args);
 }
 
 
-#if defined(ENABLE_ANNOTATIONS)
-/*
- * Class:     java/lang/reflect/Constructor
- * Method:    declaredAnnotations
- * Signature: ()Ljava/util/Map;
- */
-JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Constructor_declaredAnnotations(JNIEnv *env, struct java_lang_reflect_Constructor* this)
-{
-       java_objectheader *o = (java_objectheader*)this;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
-
-       return reflect_get_declaredannotatios(&(this->declaredAnnotations), this->annotations, this->clazz, o->vftbl->class);
-}
-
-
-/*
- * Class:     java/lang/reflect/Constructor
- * Method:    getParameterAnnotations
- * Signature: ()[[Ljava/lang/annotation/Annotation;
- */
-JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Constructor_getParameterAnnotations(JNIEnv *env, struct java_lang_reflect_Constructor* this)
-{
-       java_objectheader *o = (java_objectheader*)this;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
-
-       return reflect_get_parameterannotations((java_objectheader*)this->parameterAnnotations, this->slot, this->clazz, o->vftbl->class);
-}
-#endif
-
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where
index 669db7ee61feb34242946ea302b51379229536e6..8d4c3780131eedcb235acd5b9906d05e0a181173 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Field.c 8268 2007-08-07 13:24:43Z twisti $
+   $Id: java_lang_reflect_Field.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -33,6 +33,7 @@
 #include <stdint.h>
 
 #include "native/jni.h"
 #include <stdint.h>
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Boolean.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Boolean.h"
@@ -134,14 +135,18 @@ static void *cacao_get_field_address(java_lang_reflect_Field *this,
 {
        classinfo *c;
        fieldinfo *f;
 {
        classinfo *c;
        fieldinfo *f;
+       int32_t    slot;
+       int32_t    flag;
 
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* check field access */
        /* check if we should bypass security checks (AccessibleObject) */
 
 
        /* check field access */
        /* check if we should bypass security checks (AccessibleObject) */
 
-       if (this->flag == false) {
+       LLNI_field_get_val(this, flag, flag);
+       if (flag == false) {
                /* this function is always called like this:
 
                           java.lang.reflect.Field.xxx (Native Method)
                /* this function is always called like this:
 
                           java.lang.reflect.Field.xxx (Native Method)
@@ -193,9 +198,11 @@ JNIEXPORT int32_t JNICALL Java_java_lang_reflect_Field_getModifiersInternal(JNIE
 {
        classinfo *c;
        fieldinfo *f;
 {
        classinfo *c;
        fieldinfo *f;
+       int32_t    slot;
 
 
-       c = (classinfo *) this->clazz;
-       f = &(c->fields[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &(c->fields[slot]);
 
        return f->flags;
 }
 
        return f->flags;
 }
@@ -211,9 +218,11 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_reflect_Field_getType(JNIEnv *
        classinfo *c;
        typedesc  *desc;
        classinfo *ret;
        classinfo *c;
        typedesc  *desc;
        classinfo *ret;
+       int32_t    slot;
 
 
-       c    = (classinfo *) this->clazz;
-       desc = c->fields[this->slot].parseddesc;
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       desc = c->fields[slot].parseddesc;
 
        if (desc == NULL)
                return NULL;
 
        if (desc == NULL)
                return NULL;
@@ -235,9 +244,11 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get address of the source field value */
 
 
        /* get address of the source field value */
 
@@ -255,7 +266,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
 
                /* set the object value */
 
 
                /* set the object value */
 
-               bo->value = *((int32_t *) addr);
+               LLNI_field_set_val(bo, value, *((int32_t *) addr));
 
                /* return the wrapped object */
 
 
                /* return the wrapped object */
 
@@ -268,7 +279,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(bo = (java_lang_Byte *) builtin_new(class_java_lang_Byte)))
                        return NULL;
 
                if (!(bo = (java_lang_Byte *) builtin_new(class_java_lang_Byte)))
                        return NULL;
 
-               bo->value = *((int32_t *) addr);
+               LLNI_field_set_val(bo, value, *((int32_t *) addr));
 
                return (java_lang_Object *) bo;
        }
 
                return (java_lang_Object *) bo;
        }
@@ -279,7 +290,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(co = (java_lang_Character *) builtin_new(class_java_lang_Character)))
                        return NULL;
 
                if (!(co = (java_lang_Character *) builtin_new(class_java_lang_Character)))
                        return NULL;
 
-               co->value = *((int32_t *) addr);
+               LLNI_field_set_val(co, value, *((int32_t *) addr));
 
                return (java_lang_Object *) co;
        }
 
                return (java_lang_Object *) co;
        }
@@ -290,7 +301,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(so = (java_lang_Short *) builtin_new(class_java_lang_Short)))
                        return NULL;
 
                if (!(so = (java_lang_Short *) builtin_new(class_java_lang_Short)))
                        return NULL;
 
-               so->value = (int32_t) *((int32_t *) addr);
+               LLNI_field_set_val(so, value, (int32_t) *((int32_t *) addr));
 
                return (java_lang_Object *) so;
        }
 
                return (java_lang_Object *) so;
        }
@@ -301,7 +312,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(io = (java_lang_Integer *) builtin_new(class_java_lang_Integer)))
                        return NULL;
 
                if (!(io = (java_lang_Integer *) builtin_new(class_java_lang_Integer)))
                        return NULL;
 
-               io->value = *((int32_t *) addr);
+               LLNI_field_set_val(io, value, *((int32_t *) addr));
 
                return (java_lang_Object *) io;
        }
 
                return (java_lang_Object *) io;
        }
@@ -312,7 +323,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(lo = (java_lang_Long *) builtin_new(class_java_lang_Long)))
                        return NULL;
 
                if (!(lo = (java_lang_Long *) builtin_new(class_java_lang_Long)))
                        return NULL;
 
-               lo->value = *((int64_t *) addr);
+               LLNI_field_set_val(lo, value, *((int64_t *) addr));
 
                return (java_lang_Object *) lo;
        }
 
                return (java_lang_Object *) lo;
        }
@@ -323,7 +334,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(fo = (java_lang_Float *) builtin_new(class_java_lang_Float)))
                        return NULL;
 
                if (!(fo = (java_lang_Float *) builtin_new(class_java_lang_Float)))
                        return NULL;
 
-               fo->value = *((float *) addr);
+               LLNI_field_set_val(fo, value, *((float *) addr));
 
                return (java_lang_Object *) fo;
        }
 
                return (java_lang_Object *) fo;
        }
@@ -334,7 +345,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Field_get(JNIEnv *env
                if (!(_do = (java_lang_Double *) builtin_new(class_java_lang_Double)))
                        return NULL;
 
                if (!(_do = (java_lang_Double *) builtin_new(class_java_lang_Double)))
                        return NULL;
 
-               _do->value = *((double *) addr);
+               LLNI_field_set_val(_do, value, *((double *) addr));
 
                return (java_lang_Object *) _do;
        }
 
                return (java_lang_Object *) _do;
        }
@@ -363,11 +374,13 @@ JNIEXPORT int32_t JNICALL Java_java_lang_reflect_Field_getBoolean(JNIEnv *env, j
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -396,11 +409,13 @@ JNIEXPORT int32_t JNICALL Java_java_lang_reflect_Field_getByte(JNIEnv *env, java
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -429,11 +444,13 @@ JNIEXPORT int32_t JNICALL Java_java_lang_reflect_Field_getChar(JNIEnv *env, java
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -462,11 +479,13 @@ JNIEXPORT int32_t JNICALL Java_java_lang_reflect_Field_getShort(JNIEnv *env, jav
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -496,11 +515,13 @@ JNIEXPORT int32_t JNICALL Java_java_lang_reflect_Field_getInt(JNIEnv *env , java
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -532,11 +553,13 @@ JNIEXPORT int64_t JNICALL Java_java_lang_reflect_Field_getLong(JNIEnv *env, java
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -570,11 +593,13 @@ JNIEXPORT float JNICALL Java_java_lang_reflect_Field_getFloat(JNIEnv *env, java_
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -610,11 +635,13 @@ JNIEXPORT double JNICALL Java_java_lang_reflect_Field_getDouble(JNIEnv *env , ja
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -654,11 +681,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
        fieldinfo *sf;
        fieldinfo *df;
        void      *faddr;
        fieldinfo *sf;
        fieldinfo *df;
        void      *faddr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       dc = (classinfo *) this->clazz;
-       df = &dc->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, dc);
+       LLNI_field_get_val(this, slot , slot);
+       df = &dc->fields[slot];
 
        /* get the address of the destination field */
 
 
        /* get the address of the destination field */
 
@@ -670,7 +699,7 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
        if (value == NULL)
                sc = NULL;
        else
        if (value == NULL)
                sc = NULL;
        else
-               sc = value->header.vftbl->class;
+               LLNI_class_get(value, sc);
 
        /* The fieldid is used to set the new value, for primitive
           types the value has to be retrieved from the wrapping
 
        /* The fieldid is used to set the new value, for primitive
           types the value has to be retrieved from the wrapping
@@ -687,7 +716,7 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BOOLEAN:
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BOOLEAN:
-                       val = ((java_lang_Boolean *) value)->value;
+                       LLNI_field_get_val((java_lang_Boolean *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -706,7 +735,7 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
-                       val = ((java_lang_Byte *) value)->value;
+                       LLNI_field_get_val((java_lang_Byte *) value, value, val);
                        break;
                default:        
                        exceptions_throw_illegalargumentexception();
                        break;
                default:        
                        exceptions_throw_illegalargumentexception();
@@ -725,7 +754,7 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
                                   
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_CHAR:
                                   
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_CHAR:
-                       val = ((java_lang_Character *) value)->value;
+                       LLNI_field_get_val((java_lang_Character *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -746,10 +775,10 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
                                   
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
                                   
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
-                       val = ((java_lang_Byte *) value)->value;
+                       LLNI_field_get_val((java_lang_Byte *) value, value, val);
                        break;
                case PRIMITIVETYPE_SHORT:
                        break;
                case PRIMITIVETYPE_SHORT:
-                       val = ((java_lang_Short *) value)->value;
+                       LLNI_field_get_val((java_lang_Short *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -770,16 +799,16 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
-                       val = ((java_lang_Byte *) value)->value;
+                       LLNI_field_get_val((java_lang_Byte *) value, value, val);
                        break;
                case PRIMITIVETYPE_CHAR:
                        break;
                case PRIMITIVETYPE_CHAR:
-                       val = ((java_lang_Character *) value)->value;
+                       LLNI_field_get_val((java_lang_Character *) value, value, val);
                        break;
                case PRIMITIVETYPE_SHORT:
                        break;
                case PRIMITIVETYPE_SHORT:
-                       val = ((java_lang_Short *) value)->value;
+                       LLNI_field_get_val((java_lang_Short *) value, value, val);
                        break;
                case PRIMITIVETYPE_INT:
                        break;
                case PRIMITIVETYPE_INT:
-                       val = ((java_lang_Integer *) value)->value;
+                       LLNI_field_get_val((java_lang_Integer *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -800,19 +829,19 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
-                       val = ((java_lang_Byte *) value)->value;
+                       LLNI_field_get_val((java_lang_Byte *) value, value, val);
                        break;
                case PRIMITIVETYPE_CHAR:
                        break;
                case PRIMITIVETYPE_CHAR:
-                       val = ((java_lang_Character *) value)->value;
+                       LLNI_field_get_val((java_lang_Character *) value, value, val);
                        break;
                case PRIMITIVETYPE_SHORT:
                        break;
                case PRIMITIVETYPE_SHORT:
-                       val = ((java_lang_Short *) value)->value;
+                       LLNI_field_get_val((java_lang_Short *) value, value, val);
                        break;
                case PRIMITIVETYPE_INT:
                        break;
                case PRIMITIVETYPE_INT:
-                       val = ((java_lang_Integer *) value)->value;
+                       LLNI_field_get_val((java_lang_Integer *) value, value, val);
                        break;
                case PRIMITIVETYPE_LONG:
                        break;
                case PRIMITIVETYPE_LONG:
-                       val = ((java_lang_Long *) value)->value;
+                       LLNI_field_get_val((java_lang_Long *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -833,22 +862,22 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
-                       val = ((java_lang_Byte *) value)->value;
+                       LLNI_field_get_val((java_lang_Byte *) value, value, val);
                        break;
                case PRIMITIVETYPE_CHAR:
                        break;
                case PRIMITIVETYPE_CHAR:
-                       val = ((java_lang_Character *) value)->value;
+                       LLNI_field_get_val((java_lang_Character *) value, value, val);
                        break;
                case PRIMITIVETYPE_SHORT:
                        break;
                case PRIMITIVETYPE_SHORT:
-                       val = ((java_lang_Short *) value)->value;
+                       LLNI_field_get_val((java_lang_Short *) value, value, val);
                        break;
                case PRIMITIVETYPE_INT:
                        break;
                case PRIMITIVETYPE_INT:
-                       val = ((java_lang_Integer *) value)->value;
+                       LLNI_field_get_val((java_lang_Integer *) value, value, val);
                        break;
                case PRIMITIVETYPE_LONG:
                        break;
                case PRIMITIVETYPE_LONG:
-                       val = ((java_lang_Long *) value)->value;
+                       LLNI_field_get_val((java_lang_Long *) value, value, val);
                        break;
                case PRIMITIVETYPE_FLOAT:
                        break;
                case PRIMITIVETYPE_FLOAT:
-                       val = ((java_lang_Float *) value)->value;
+                       LLNI_field_get_val((java_lang_Float *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -869,25 +898,25 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_set(JNIEnv *env, java_lang_r
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
 
                switch (sf->parseddesc->decltype) {
                case PRIMITIVETYPE_BYTE:
-                       val = ((java_lang_Byte *) value)->value;
+                       LLNI_field_get_val((java_lang_Byte *) value, value, val);
                        break;
                case PRIMITIVETYPE_CHAR:
                        break;
                case PRIMITIVETYPE_CHAR:
-                       val = ((java_lang_Character *) value)->value;
+                       LLNI_field_get_val((java_lang_Character *) value, value, val);
                        break;
                case PRIMITIVETYPE_SHORT:
                        break;
                case PRIMITIVETYPE_SHORT:
-                       val = ((java_lang_Short *) value)->value;
+                       LLNI_field_get_val((java_lang_Short *) value, value, val);
                        break;
                case PRIMITIVETYPE_INT:
                        break;
                case PRIMITIVETYPE_INT:
-                       val = ((java_lang_Integer *) value)->value;
+                       LLNI_field_get_val((java_lang_Integer *) value, value, val);
                        break;
                case PRIMITIVETYPE_LONG:
                        break;
                case PRIMITIVETYPE_LONG:
-                       val = ((java_lang_Long *) value)->value;
+                       LLNI_field_get_val((java_lang_Long *) value, value, val);
                        break;
                case PRIMITIVETYPE_FLOAT:
                        break;
                case PRIMITIVETYPE_FLOAT:
-                       val = ((java_lang_Float *) value)->value;
+                       LLNI_field_get_val((java_lang_Float *) value, value, val);
                        break;
                case PRIMITIVETYPE_DOUBLE:
                        break;
                case PRIMITIVETYPE_DOUBLE:
-                       val = ((java_lang_Double *) value)->value;
+                       LLNI_field_get_val((java_lang_Double *) value, value, val);
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
                        break;
                default:
                        exceptions_throw_illegalargumentexception();
@@ -925,11 +954,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setBoolean(JNIEnv *env, java
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -960,11 +991,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setByte(JNIEnv *env, java_la
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1006,11 +1039,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setChar(JNIEnv *env, java_la
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1051,11 +1086,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setShort(JNIEnv *env, java_l
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1096,11 +1133,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setInt(JNIEnv *env, java_lan
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1140,11 +1179,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setLong(JNIEnv *env, java_la
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1181,11 +1222,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setFloat(JNIEnv *env, java_l
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1219,11 +1262,13 @@ JNIEXPORT void JNICALL Java_java_lang_reflect_Field_setDouble(JNIEnv *env, java_
        classinfo *c;
        fieldinfo *f;
        void      *addr;
        classinfo *c;
        fieldinfo *f;
        void      *addr;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        /* get the address of the field with an internal helper */
 
 
        /* get the address of the field with an internal helper */
 
@@ -1254,11 +1299,13 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_reflect_Field_getSignature(JN
        classinfo         *c;
        fieldinfo         *f;
        java_objectheader *o;
        classinfo         *c;
        fieldinfo         *f;
        java_objectheader *o;
+       int32_t    slot;
 
        /* get the class and the field */
 
 
        /* get the class and the field */
 
-       c = (classinfo *) this->clazz;
-       f = &c->fields[this->slot];
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       f = &c->fields[slot];
 
        if (f->signature == NULL)
                return NULL;
 
        if (f->signature == NULL)
                return NULL;
index b0586e05a3e3eebdd15469d745cbba72c858537c..e89ad411481310079e1030321679c202c09bfa73 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_reflect_Method.c 8262 2007-08-06 12:44:01Z panzi $
+   $Id: java_lang_reflect_Method.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
 
 #include <assert.h>
 
 
 #include <assert.h>
 
-#if defined(ENABLE_ANNOTATIONS)
-#include "vm/vm.h"
-#endif
-
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_Class.h"
 #include "native/include/java_lang_String.h"
 
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_Class.h"
 #include "native/include/java_lang_String.h"
 
-#if defined(ENABLE_ANNOTATIONS)
-#include "native/include/sun_reflect_ConstantPool.h"
-#include "native/vm/reflect.h"
-#endif
-
 #include "native/include/java_lang_reflect_Method.h"
 
 #include "native/vm/java_lang_reflect_Method.h"
 #include "native/include/java_lang_reflect_Method.h"
 
 #include "native/vm/java_lang_reflect_Method.h"
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
 /* native methods implemented by this file ************************************/
 
 static JNINativeMethod methods[] = {
-       { "getModifiersInternal",    "()I",                                                                         (void *) (ptrint) &Java_java_lang_reflect_Method_getModifiersInternal    },
-       { "getReturnType",           "()Ljava/lang/Class;",                                                         (void *) (ptrint) &Java_java_lang_reflect_Method_getReturnType           },
-       { "getParameterTypes",       "()[Ljava/lang/Class;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getParameterTypes       },
-       { "getExceptionTypes",       "()[Ljava/lang/Class;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getExceptionTypes       },
-       { "invokeNative",            "(Ljava/lang/Object;[Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object;", (void *) (ptrint) &Java_java_lang_reflect_Method_invokeNative            },
-       { "getSignature",            "()Ljava/lang/String;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getSignature            },
-#if defined(ENABLE_ANNOTATIONS)
-       { "getDefaultValue",         "()Ljava/lang/Object;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getDefaultValue         },
-       { "declaredAnnotations",     "()Ljava/util/Map;",                                                           (void *) (ptrint) &Java_java_lang_reflect_Method_declaredAnnotations     },
-       { "getParameterAnnotations", "()[[Ljava/lang/annotation/Annotation;",                                       (void *) (ptrint) &Java_java_lang_reflect_Method_getParameterAnnotations },
-#endif
+       { "getModifiersInternal", "()I",                                                                         (void *) (ptrint) &Java_java_lang_reflect_Method_getModifiersInternal },
+       { "getReturnType",        "()Ljava/lang/Class;",                                                         (void *) (ptrint) &Java_java_lang_reflect_Method_getReturnType        },
+       { "getParameterTypes",    "()[Ljava/lang/Class;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getParameterTypes    },
+       { "getExceptionTypes",    "()[Ljava/lang/Class;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getExceptionTypes    },
+       { "invokeNative",         "(Ljava/lang/Object;[Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object;", (void *) (ptrint) &Java_java_lang_reflect_Method_invokeNative         },
+       { "getSignature",         "()Ljava/lang/String;",                                                        (void *) (ptrint) &Java_java_lang_reflect_Method_getSignature         },
 };
 
 
 };
 
 
@@ -106,9 +93,11 @@ JNIEXPORT s4 JNICALL Java_java_lang_reflect_Method_getModifiersInternal(JNIEnv *
 {
        classinfo  *c;
        methodinfo *m;
 {
        classinfo  *c;
        methodinfo *m;
+       int32_t     slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        return m->flags;
 }
 
        return m->flags;
 }
@@ -124,9 +113,11 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_reflect_Method_getReturnType(J
        classinfo  *c;
        methodinfo *m;
        classinfo  *result;
        classinfo  *c;
        methodinfo *m;
        classinfo  *result;
+       int32_t     slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        result = method_returntype_get(m);
 
 
        result = method_returntype_get(m);
 
@@ -143,9 +134,11 @@ JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getParameterTy
 {
        classinfo  *c;
        methodinfo *m;
 {
        classinfo  *c;
        methodinfo *m;
+       int32_t     slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        return method_get_parametertypearray(m);
 }
 
        return method_get_parametertypearray(m);
 }
@@ -160,9 +153,11 @@ JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getExceptionTy
 {
        classinfo  *c;
        methodinfo *m;
 {
        classinfo  *c;
        methodinfo *m;
+       int32_t     slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        return method_get_exceptionarray(m);
 }
 
        return method_get_exceptionarray(m);
 }
@@ -177,8 +172,8 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_reflect_Method_invokeNative(J
 {
        /* just to be sure */
 
 {
        /* just to be sure */
 
-       assert(this->clazz == clazz);
-       assert(this->slot           == slot);
+       assert(LLNI_field_direct(this, clazz) == clazz);
+       assert(LLNI_field_direct(this, slot)  == slot);
 
        return _Jv_java_lang_reflect_Method_invoke(this, o, args);
 }
 
        return _Jv_java_lang_reflect_Method_invoke(this, o, args);
 }
@@ -194,9 +189,11 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_reflect_Method_getSignature(J
        classinfo         *c;
        methodinfo        *m;
        java_objectheader *o;
        classinfo         *c;
        methodinfo        *m;
        java_objectheader *o;
+       int32_t            slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        if (m->signature == NULL)
                return NULL;
 
        if (m->signature == NULL)
                return NULL;
@@ -208,104 +205,6 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_reflect_Method_getSignature(J
        return (java_lang_String *) o;
 }
 
        return (java_lang_String *) o;
 }
 
-#if defined(ENABLE_ANNOTATIONS)
-/*
- * Class:     java/lang/reflect/Method
- * Method:    getDefaultValue
- * Signature: ()Ljava/lang/Object;
- */
-JNIEXPORT struct java_lang_Object* JNICALL Java_java_lang_reflect_Method_getDefaultValue(JNIEnv *env, struct java_lang_reflect_Method* this)
-{
-       static methodinfo        *m_parseAnnotationDefault   = NULL;
-       utf                      *utf_parseAnnotationDefault = NULL;
-       utf                      *utf_desc     = NULL;
-       sun_reflect_ConstantPool *constantPool = NULL;
-       java_objectheader        *o            = (java_objectheader*)this;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
-
-       constantPool = 
-               (sun_reflect_ConstantPool*)native_new_and_init(
-                       class_sun_reflect_ConstantPool);
-       
-       if(constantPool == NULL) {
-               /* out of memory */
-               return NULL;
-       }
-
-       constantPool->constantPoolOop = (java_lang_Object*)this->clazz;
-
-       /* only resolve the method the first time */
-       if (m_parseAnnotationDefault == NULL) {
-               utf_parseAnnotationDefault = utf_new_char("parseAnnotationDefault");
-               utf_desc = utf_new_char(
-                       "(Ljava/lang/reflect/Method;[BLsun/reflect/ConstantPool;)"
-                       "Ljava/lang/Object;");
-
-               if (utf_parseAnnotationDefault == NULL || utf_desc == NULL) {
-                       /* out of memory */
-                       return NULL;
-               }
-
-               m_parseAnnotationDefault = class_resolveclassmethod(
-                       class_sun_reflect_annotation_AnnotationParser,
-                       utf_parseAnnotationDefault,
-                       utf_desc,
-                       o->vftbl->class,
-                       true);
-
-               if (m_parseAnnotationDefault == NULL)
-               {
-                       /* method not found */
-                       return NULL;
-               }
-       }
-
-       return (java_lang_Object*)vm_call_method(
-               m_parseAnnotationDefault, NULL,
-               this, this->annotationDefault, constantPool);
-}
-
-
-/*
- * Class:     java/lang/reflect/Method
- * Method:    declaredAnnotations
- * Signature: ()Ljava/util/Map;
- */
-JNIEXPORT struct java_util_Map* JNICALL Java_java_lang_reflect_Method_declaredAnnotations(JNIEnv *env, struct java_lang_reflect_Method* this)
-{
-       java_objectheader *o = (java_objectheader*)this;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
-
-       return reflect_get_declaredannotatios(&(this->declaredAnnotations), this->annotations, this->clazz, o->vftbl->class);
-}
-
-
-/*
- * Class:     java/lang/reflect/Method
- * Method:    getParameterAnnotations
- * Signature: ()[[Ljava/lang/annotation/Annotation;
- */
-JNIEXPORT java_objectarray* JNICALL Java_java_lang_reflect_Method_getParameterAnnotations(JNIEnv *env, struct java_lang_reflect_Method* this)
-{
-       java_objectheader *o = (java_objectheader*)this;
-
-       if (this == NULL) {
-               exceptions_throw_nullpointerexception();
-               return NULL;
-       }
-
-       return reflect_get_parameterannotations((java_objectheader*)this->parameterAnnotations, this->slot, this->clazz, o->vftbl->class);
-}
-#endif
-
 
 /*
  * These are local overrides for various environment variables in Emacs.
 
 /*
  * These are local overrides for various environment variables in Emacs.
index 0237d75c76e4e731503c968adcd270bda53621c5..acdb88360db51740c2b132d40812f7b18fa1cd67 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_Class.c 8262 2007-08-06 12:44:01Z panzi $
+   $Id: java_lang_Class.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -38,6 +38,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 /* keep this order of the native includes */
 #include "native/native.h"
 
 /* keep this order of the native includes */
@@ -94,6 +95,7 @@ java_lang_String *_Jv_java_lang_Class_getName(java_lang_Class *klass)
 {
        classinfo        *c;
        java_lang_String *s;
 {
        classinfo        *c;
        java_lang_String *s;
+       java_chararray   *ca;
        u4                i;
 
        c = (classinfo *) klass;
        u4                i;
 
        c = (classinfo *) klass;
@@ -107,9 +109,11 @@ java_lang_String *_Jv_java_lang_Class_getName(java_lang_Class *klass)
 
        /* return string where '/' is replaced by '.' */
 
 
        /* return string where '/' is replaced by '.' */
 
-       for (i = 0; i < s->value->header.size; i++) {
-               if (s->value->data[i] == '/')
-                       s->value->data[i] = '.';
+       LLNI_field_get_ref(s, value, ca);
+
+       for (i = 0; i < ca->header.size; i++) {
+               if (ca->data[i] == '/')
+                       ca->data[i] = '.';
        }
 
        return s;
        }
 
        return s;
@@ -154,7 +158,7 @@ java_lang_Class *_Jv_java_lang_Class_forName(java_lang_String *name)
 
        /* name must not contain '/' (mauve test) */
 
 
        /* name must not contain '/' (mauve test) */
 
-       for (i = 0, pos = name->value->data + name->offset; i < name->count; i++, pos++) {
+       for (i = 0, pos = LLNI_field_direct(name, value)->data + LLNI_field_direct(name, offset); i < LLNI_field_direct(name, count); i++, pos++) {
                if (*pos == '/') {
                        exceptions_throw_classnotfoundexception(uname);
                        return NULL;
                if (*pos == '/') {
                        exceptions_throw_classnotfoundexception(uname);
                        return NULL;
index 0c22e7b81ce45d9c7e3ece8318c89da172533a4c..d09e4592b002c5fd362e75fc19befac8da8e64c8 100644 (file)
@@ -39,6 +39,7 @@
 #include "vm/global.h"                          /* required by native headers */
 
 #include "native/jni.h"
 #include "vm/global.h"                          /* required by native headers */
 
 #include "native/jni.h"
+#include "native/llni.h"
 
 /* keep this order of the native includes */
 
 
 /* keep this order of the native includes */
 
@@ -140,7 +141,7 @@ java_lang_Class *_Jv_java_lang_ClassLoader_defineClass(java_lang_ClassLoader *cl
 #if defined(WITH_CLASSPATH_GNU)
        /* set ProtectionDomain */
 
 #if defined(WITH_CLASSPATH_GNU)
        /* set ProtectionDomain */
 
-       o->pd = pd;
+       LLNI_field_set_ref(o, pd, pd);
 #endif
 
        return o;
 #endif
 
        return o;
index be107dde0f1a04a3dc94808e025c658e6c6184bd..e96faf429053feb28535335abbf7381731bc904c 100644 (file)
@@ -34,6 +34,7 @@
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_String.h"            /* required by j.l.CL */
 
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_String.h"            /* required by j.l.CL */
@@ -92,7 +93,7 @@ java_lang_Class *_Jv_java_lang_Object_getClass(java_lang_Object *obj)
 void _Jv_java_lang_Object_notify(java_lang_Object *this)
 {
 #if defined(ENABLE_THREADS)
 void _Jv_java_lang_Object_notify(java_lang_Object *this)
 {
 #if defined(ENABLE_THREADS)
-       lock_notify_object(&this->header);
+       lock_notify_object(&LLNI_field_direct(this, header));
 #endif
 }
 
 #endif
 }
 
@@ -105,7 +106,7 @@ void _Jv_java_lang_Object_notify(java_lang_Object *this)
 void _Jv_java_lang_Object_notifyAll(java_lang_Object *this)
 {
 #if defined(ENABLE_THREADS)
 void _Jv_java_lang_Object_notifyAll(java_lang_Object *this)
 {
 #if defined(ENABLE_THREADS)
-       lock_notify_all_object(&this->header);
+       lock_notify_all_object(&LLNI_field_direct(this, header));
 #endif
 }
 
 #endif
 }
 
@@ -123,7 +124,7 @@ void _Jv_java_lang_Object_wait(java_lang_Object *o, s8 ms, s4 ns)
 #endif
 
 #if defined(ENABLE_THREADS)
 #endif
 
 #if defined(ENABLE_THREADS)
-       lock_wait_for_object(&o->header, ms, ns);
+       lock_wait_for_object(&LLNI_field_direct(o, header), ms, ns);
 #endif
 
 #if defined(ENABLE_JVMTI)
 #endif
 
 #if defined(ENABLE_JVMTI)
index 4ce1368c6c54af32cb562a27f6cb6aabfc8f3b66..422e780c3bb178a4483f01660bd01d25994bd544 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 
 #include "native/jni.h"
 #include <stdlib.h>
 
 #include "native/jni.h"
+#include "native/llni.h"
 
 #include "native/include/java_lang_String.h"
 
 
 #include "native/include/java_lang_String.h"
 
@@ -52,7 +53,7 @@ java_lang_String *_Jv_java_lang_String_intern(java_lang_String *s)
 
        /* search table so identical strings will get identical pointers */
 
 
        /* search table so identical strings will get identical pointers */
 
-       o = literalstring_u2(s->value, s->count, s->offset, true);
+       o = literalstring_u2(LLNI_field_direct(s, value), LLNI_field_direct(s, count), LLNI_field_direct(s, offset), true);
 
        return (java_lang_String *) o;
 }
 
        return (java_lang_String *) o;
 }
index 5b5f266488aa315f487ad2fe63c49e74b17ad49f..0742d1740487e38bcd1b11ad6ea4684875f61bcc 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_Thread.c 8272 2007-08-08 14:55:00Z twisti $
+   $Id: java_lang_Thread.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -31,6 +31,7 @@
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_String.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_String.h"
@@ -108,7 +109,7 @@ void _Jv_java_lang_Thread_interrupt(java_lang_Thread *this)
        threadobject *thread;
 
 #if defined(WITH_CLASSPATH_GNU)
        threadobject *thread;
 
 #if defined(WITH_CLASSPATH_GNU)
-       thread = (threadobject *) this->vmThread->vmdata;
+       thread = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 #elif defined(WITH_CLASSPATH_CLDC1_1)
        thread = (threadobject *) this->vm_thread;
 #endif
 #elif defined(WITH_CLASSPATH_CLDC1_1)
        thread = (threadobject *) this->vm_thread;
 #endif
@@ -130,7 +131,7 @@ s4 _Jv_java_lang_Thread_isAlive(java_lang_Thread *this)
 
 # if defined(WITH_CLASSPATH_GNU)
 
 
 # if defined(WITH_CLASSPATH_GNU)
 
-       t = (threadobject *) this->vmThread->vmdata;
+       t = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 
 # elif defined(WITH_CLASSPATH_SUN)
 
 
 # elif defined(WITH_CLASSPATH_SUN)
 
@@ -178,7 +179,7 @@ s4 _Jv_java_lang_Thread_isInterrupted(java_lang_Thread *this)
        threadobject *t;
 
 # if defined(WITH_CLASSPATH_GNU)
        threadobject *t;
 
 # if defined(WITH_CLASSPATH_GNU)
-       t = (threadobject *) this->vmThread->vmdata;
+       t = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 # elif defined(WITH_CLASSPATH_SUN)
        /* XXX this is just a quick hack */
 
 # elif defined(WITH_CLASSPATH_SUN)
        /* XXX this is just a quick hack */
 
@@ -234,7 +235,7 @@ void _Jv_java_lang_Thread_setPriority(java_lang_Thread *this, s4 priority)
        threadobject *t;
 
 # if defined(WITH_CLASSPATH_GNU)
        threadobject *t;
 
 # if defined(WITH_CLASSPATH_GNU)
-       t = (threadobject *) this->vmThread->vmdata;
+       t = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 # elif defined(WITH_CLASSPATH_SUN)
        /* XXX this is just a quick hack */
 
 # elif defined(WITH_CLASSPATH_SUN)
        /* XXX this is just a quick hack */
 
@@ -298,13 +299,13 @@ java_lang_Thread *_Jv_java_lang_Thread_currentThread(void)
                log_text("t ptr is NULL\n");
 
 # if defined(ENABLE_JAVASE)
                log_text("t ptr is NULL\n");
 
 # if defined(ENABLE_JAVASE)
-       if (t->group == NULL) {
+       if (LLNI_field_direct(t, group) == NULL) {
                /* ThreadGroup of currentThread is not initialized */
 
                /* ThreadGroup of currentThread is not initialized */
 
-               t->group = (java_lang_ThreadGroup *)
+               LLNI_field_direct(t, group) = (java_lang_ThreadGroup *)
                        native_new_and_init(class_java_lang_ThreadGroup);
 
                        native_new_and_init(class_java_lang_ThreadGroup);
 
-               if (t->group == NULL)
+               if (LLNI_field_direct(t, group) == NULL)
                        log_text("unable to create ThreadGroup");
        }
 # endif
                        log_text("unable to create ThreadGroup");
        }
 # endif
@@ -384,7 +385,7 @@ java_lang_String *_Jv_java_lang_Thread_getState(java_lang_Thread *this)
        java_objectheader *o;
 
 # if defined(WITH_CLASSPATH_GNU)
        java_objectheader *o;
 
 # if defined(WITH_CLASSPATH_GNU)
-       thread = (threadobject *) this->vmThread->vmdata;
+       thread = (threadobject *) LLNI_field_direct(LLNI_field_direct(this, vmThread), vmdata);
 # elif defined(WITH_CLASSPATH_CLDC1_1)
        thread = (threadobject *) this->vm_thread;
 # endif
 # elif defined(WITH_CLASSPATH_CLDC1_1)
        thread = (threadobject *) this->vm_thread;
 # endif
index 584b00f4ef02f93fe1ad5667f0df5bab9e762873..77131359c931a0083673bffb37f42fd7ef040235 100644 (file)
@@ -35,6 +35,7 @@
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #if defined(WITH_CLASSPATH_SUN)
 #include "native/native.h"
 
 #if defined(WITH_CLASSPATH_SUN)
@@ -71,9 +72,11 @@ s4 _Jv_java_lang_reflect_Constructor_getModifiers(JNIEnv *env, java_lang_reflect
 {
        classinfo  *c;
        methodinfo *m;
 {
        classinfo  *c;
        methodinfo *m;
+       int32_t     slot;
 
 
-       c = (classinfo *) (this->clazz);
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        return m->flags;
 }
 
        return m->flags;
 }
@@ -88,9 +91,11 @@ java_objectarray *_Jv_java_lang_reflect_Constructor_getParameterTypes(JNIEnv *en
 {
        classinfo  *c;
        methodinfo *m;
 {
        classinfo  *c;
        methodinfo *m;
+       int32_t     slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        return method_get_parametertypearray(m);
 }
 
        return method_get_parametertypearray(m);
 }
@@ -105,9 +110,11 @@ java_objectarray *_Jv_java_lang_reflect_Constructor_getExceptionTypes(JNIEnv *en
 {
        classinfo  *c;
        methodinfo *m;
 {
        classinfo  *c;
        methodinfo *m;
+       int32_t     slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        return method_get_exceptionarray(m);
 }
 
        return method_get_exceptionarray(m);
 }
@@ -124,18 +131,20 @@ java_lang_Object *_Jv_java_lang_reflect_Constructor_newInstance(JNIEnv *env, jav
        methodinfo        *m;
        s4                 override;
        java_objectheader *o;
        methodinfo        *m;
        s4                 override;
        java_objectheader *o;
+       int32_t            slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        /* check method access */
 
        /* check if we should bypass security checks (AccessibleObject) */
 
 #if defined(WITH_CLASSPATH_GNU)
 
        /* check method access */
 
        /* check if we should bypass security checks (AccessibleObject) */
 
 #if defined(WITH_CLASSPATH_GNU)
-       override = this->flag;
+       LLNI_field_get_val(this, flag, override);
 #elif defined(WITH_CLASSPATH_SUN)
 #elif defined(WITH_CLASSPATH_SUN)
-       override = this->override;
+       LLNI_field_get_val(this, override, override);
 #else
 # error unknown classpath configuration
 #endif
 #else
 # error unknown classpath configuration
 #endif
@@ -170,9 +179,11 @@ java_lang_String *_Jv_java_lang_reflect_Constructor_getSignature(JNIEnv *env, ja
        classinfo         *c;
        methodinfo        *m;
        java_objectheader *o;
        classinfo         *c;
        methodinfo        *m;
        java_objectheader *o;
+       int32_t            slot;
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
        if (m->signature == NULL)
                return NULL;
 
        if (m->signature == NULL)
                return NULL;
index 0830afd22627eb06a1e674501ffef71e7b18c6a1..f7d5707b64468ef5611b120b83448992087af8fe 100644 (file)
@@ -34,6 +34,7 @@
 #include "vm/types.h"
 
 #include "native/jni.h"
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"
@@ -58,18 +59,21 @@ java_lang_Object *_Jv_java_lang_reflect_Method_invoke(java_lang_reflect_Method *
        classinfo  *c;
        methodinfo *m;
        s4          override;
        classinfo  *c;
        methodinfo *m;
        s4          override;
+       int32_t     slot;
+
+       LLNI_field_get_cls(this, clazz, c);
+       LLNI_field_get_val(this, slot , slot);
+       m = &(c->methods[slot]);
 
 
-       c = (classinfo *) this->clazz;
-       m = &(c->methods[this->slot]);
 
        /* check method access */
 
        /* check if we should bypass security checks (AccessibleObject) */
 
 #if defined(WITH_CLASSPATH_GNU)
 
        /* check method access */
 
        /* check if we should bypass security checks (AccessibleObject) */
 
 #if defined(WITH_CLASSPATH_GNU)
-       override = this->flag;
+       LLNI_field_get_val(this, flag, override);
 #elif defined(WITH_CLASSPATH_SUN)
 #elif defined(WITH_CLASSPATH_SUN)
-       override = this->override;
+       LLNI_field_get_val(this, override, override);
 #else
 # error unknown classpath configuration
 #endif
 #else
 # error unknown classpath configuration
 #endif
index 60f91bed5bb900bd037dac586f125fe2a4596282..098a8140f3ae179e0381a5fab9921f6a8ad3e026 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: reflect.c 8262 2007-08-06 12:44:01Z panzi $
+   $Id: reflect.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -42,6 +42,7 @@
 #endif
 
 #include "native/jni.h"
 #endif
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 /* keep this order of the native includes */
 #include "native/native.h"
 
 /* keep this order of the native includes */
@@ -133,24 +134,24 @@ java_lang_reflect_Constructor *reflect_constructor_new(methodinfo *m)
 
 #if defined(WITH_CLASSPATH_GNU)
 
 
 #if defined(WITH_CLASSPATH_GNU)
 
-       rc->clazz                = (java_lang_Class *) c;
-       rc->slot                 = slot;
+       LLNI_field_set_cls(rc, clazz               , c);
+       LLNI_field_set_val(rc, slot                , slot);
 
        /* TODO: add these private fields to java.lang.reflect.Constructor
 
        /* TODO: add these private fields to java.lang.reflect.Constructor
-       rc->annotations          = annotations;
-       rc->parameterAnnotations = parameterAnnotations;
+       LLNI_field_set_ref(rc, annotations         , annotations);
+       LLNI_field_set_ref(rc, parameterAnnotations, parameterAnnotations);
        */
 
 #elif defined(WITH_CLASSPATH_SUN)
 
        */
 
 #elif defined(WITH_CLASSPATH_SUN)
 
-       rc->clazz                = (java_lang_Class *) c;
-       rc->parameterTypes       = method_get_parametertypearray(m);
-       rc->exceptionTypes       = method_get_exceptionarray(m);
-       rc->modifiers            = m->flags & ACC_CLASS_REFLECT_MASK;
-       rc->slot                 = slot;
-       rc->signature            = m->signature ? (java_lang_String *) javastring_new(m->signature) : NULL;
-       rc->annotations          = annotations;
-       rc->parameterAnnotations = parameterAnnotations;
+       LLNI_field_set_cls(rc, clazz               , c);
+       LLNI_field_set_ref(rc, parameterTypes      , method_get_parametertypearray(m));
+       LLNI_field_set_ref(rc, exceptionTypes      , method_get_exceptionarray(m));
+       LLNI_field_set_val(rc, modifiers           , m->flags & ACC_CLASS_REFLECT_MASK);
+       LLNI_field_set_val(rc, slot                , slot);
+       LLNI_field_set_ref(rc, signature           , m->signature ? (java_lang_String *) javastring_new(m->signature) : NULL);
+       LLNI_field_set_ref(rc, annotations         , annotations);
+       LLNI_field_set_ref(rc, parameterAnnotations, parameterAnnotations);
 
 #else
 # error unknown classpath configuration
 
 #else
 # error unknown classpath configuration
@@ -211,28 +212,28 @@ java_lang_reflect_Field *reflect_field_new(fieldinfo *f)
 
 #if defined(WITH_CLASSPATH_GNU)
 
 
 #if defined(WITH_CLASSPATH_GNU)
 
-       rf->clazz = (java_lang_Class *) c;
+       LLNI_field_set_cls(rf, clazz         , c);
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
-       rf->name           = _Jv_java_lang_String_intern((java_lang_String *) javastring_new(f->name));
-       rf->slot           = slot;
-       rf->annotations    = annotations;
+       LLNI_field_set_ref(rf, name          , _Jv_java_lang_String_intern((java_lang_String *) javastring_new(f->name)));
+       LLNI_field_set_val(rf, slot          , slot);
+       LLNI_field_set_ref(rf, annotations   , annotations);
 
 #elif defined(WITH_CLASSPATH_SUN)
 
 
 #elif defined(WITH_CLASSPATH_SUN)
 
-       rf->clazz          = (java_lang_Class *) c;
+       LLNI_field_set_cls(rf, clazz         , c);
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
-       rf->name           = _Jv_java_lang_String_intern((java_lang_String *) javastring_new(f->name));
-       rf->type           = (java_lang_Class *) field_get_type(f);
-       rf->modifiers      = f->flags;
-       rf->slot           = slot;
-       rf->signature      = f->signature ? (java_lang_String *) javastring_new(f->signature) : NULL;
-       rf->annotations    = annotations;
+       LLNI_field_set_ref(rf, name           = _Jv_java_lang_String_intern((java_lang_String *) javastring_new(f->name)));
+       LLNI_field_set_cls(rf, type          , (java_lang_Class *) field_get_type(f));
+       LLNI_field_set_val(rf, modifiers     , f->flags);
+       LLNI_field_set_val(rf, slot          , slot);
+       LLNI_field_set_ref(rf, signature     , f->signature ? (java_lang_String *) javastring_new(f->signature) : NULL);
+       LLNI_field_set_ref(rf, annotations   , annotations);
 
 #else
 # error unknown classpath configuration
 
 #else
 # error unknown classpath configuration
@@ -319,20 +320,20 @@ java_lang_reflect_Method *reflect_method_new(methodinfo *m)
 
 #if defined(WITH_CLASSPATH_GNU)
 
 
 #if defined(WITH_CLASSPATH_GNU)
 
-       rm->clazz                = (java_lang_Class *) m->class;
+       LLNI_field_set_cls(rm, clazz               , m->class);
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
-       rm->name                 = _Jv_java_lang_String_intern((java_lang_String *) javastring_new(m->name));
-       rm->slot                 = slot;
-       rm->annotations          = annotations;
-       rm->parameterAnnotations = parameterAnnotations;
-       rm->annotationDefault    = annotationDefault;
+       LLNI_field_set_ref(rm, name                , _Jv_java_lang_String_intern((java_lang_String *) javastring_new(m->name)));
+       LLNI_field_set_val(rm, slot                , slot);
+       LLNI_field_set_ref(rm, annotations         , annotations);
+       LLNI_field_set_ref(rm, parameterAnnotations, parameterAnnotations);
+       LLNI_field_set_ref(rm, annotationDefault   , annotationDefault);
 
 #elif defined(WITH_CLASSPATH_SUN)
 
 
 #elif defined(WITH_CLASSPATH_SUN)
 
-       rm->clazz                = (java_lang_Class *) m->class;
+       LLNI_field_set_cls(rm, clazz                = (java_lang_Class *) m->class;
 
        /* The name needs to be interned */
        /* XXX implement me better! */
 
        /* The name needs to be interned */
        /* XXX implement me better! */
index f01491d5a008b1828320decbe7b04564467af809..807027cbaad779826da1dacc989ec11530832eee 100644 (file)
@@ -34,6 +34,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"                  /* before c.l.C */
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"                  /* before c.l.C */
@@ -371,9 +372,11 @@ JNIEXPORT int64_t JNICALL Java_sun_misc_Unsafe_objectFieldOffset(JNIEnv *env, su
 {
        classinfo *c;
        fieldinfo *f;
 {
        classinfo *c;
        fieldinfo *f;
+       int32_t    slot;
 
 
-       c = (classinfo *) field->clazz;
-       f = &c->fields[field->slot];
+       LLNI_field_get_cls(field, clazz, c);
+       LLNI_field_get_val(field, slot , slot);
+       f = &c->fields[slot];
 
        return (int64_t) f->offset;
 }
 
        return (int64_t) f->offset;
 }
@@ -431,9 +434,11 @@ JNIEXPORT int64_t JNICALL Java_sun_misc_Unsafe_staticFieldOffset(JNIEnv *env, su
 {
        classinfo *c;
        fieldinfo *f;
 {
        classinfo *c;
        fieldinfo *f;
+       int32_t    slot;
 
 
-       c = (classinfo *) field->clazz;
-       f = &(c->fields[field->slot]);
+       LLNI_field_get_cls(field, clazz, c);
+       LLNI_field_get_val(field, slot , slot);
+       f = &(c->fields[slot]);
 
        return (int64_t) (intptr_t) f->value;
 }
 
        return (int64_t) (intptr_t) f->value;
 }
@@ -576,7 +581,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_sun_misc_Unsafe_defineClass__Ljava_lang_
 #if defined(WITH_CLASSPATH_GNU)
        /* set ProtectionDomain */
 
 #if defined(WITH_CLASSPATH_GNU)
        /* set ProtectionDomain */
 
-       o->pd = protectionDomain;
+       LLNI_field_set_ref(o, pd, protectionDomain);
 #endif
 
        return o;
 #endif
 
        return o;
index 27dbc63c2096ca597bcac34b771b56f2dd618cbc..671f45fa4a6e0e93898ffac10a37150f05592874 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: threads.c 8132 2007-06-22 11:15:47Z twisti $
+   $Id: threads.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -57,6 +57,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_String.h"
 #include "native/native.h"
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_String.h"
@@ -867,8 +868,8 @@ bool threads_init(void)
 
        /* set the thread */
 
 
        /* set the thread */
 
-       vmt->thread = t;
-       vmt->vmdata = (java_lang_Object *) mainthread;
+       LLNI_field_set_ref(vmt, thread, t);
+       LLNI_field_set_val(vmt, vmdata, (java_lang_Object *) mainthread);
 
        /* call java.lang.Thread.<init>(Ljava/lang/VMThread;Ljava/lang/String;IZ)V */
        o = (java_objectheader *) t;
 
        /* call java.lang.Thread.<init>(Ljava/lang/VMThread;Ljava/lang/String;IZ)V */
        o = (java_objectheader *) t;
@@ -902,7 +903,7 @@ bool threads_init(void)
                return false;
 
 #if defined(ENABLE_JAVASE)
                return false;
 
 #if defined(ENABLE_JAVASE)
-       t->group = threadgroup;
+       LLNI_field_set_ref(t, group, threadgroup);
 
 # if defined(WITH_CLASSPATH_GNU)
        /* add main thread to java.lang.ThreadGroup */
 
 # if defined(WITH_CLASSPATH_GNU)
        /* add main thread to java.lang.ThreadGroup */
@@ -1018,7 +1019,7 @@ static void *threads_startup_thread(void *arg)
 
        /* set our priority */
 
 
        /* set our priority */
 
-       threads_set_thread_priority(thread->tid, thread->object->priority);
+       threads_set_thread_priority(thread->tid, LLNI_field_direct(thread->object, priority));
 
        /* thread is completely initialized */
 
 
        /* thread is completely initialized */
 
@@ -1085,7 +1086,7 @@ static void *threads_startup_thread(void *arg)
 #if defined(WITH_CLASSPATH_GNU)
                /* we need to start the run method of java.lang.VMThread */
 
 #if defined(WITH_CLASSPATH_GNU)
                /* we need to start the run method of java.lang.VMThread */
 
-               vmt = (java_lang_VMThread *) thread->object->vmThread;
+               vmt = (java_lang_VMThread *) LLNI_field_direct(thread->object, vmThread);
                o   = (java_objectheader *) vmt;
 
 #elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
                o   = (java_objectheader *) vmt;
 
 #elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
@@ -1256,6 +1257,7 @@ bool threads_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
 #if defined(ENABLE_JAVASE)
        java_lang_ThreadGroup *group;
        threadobject          *mainthread;
 #if defined(ENABLE_JAVASE)
        java_lang_ThreadGroup *group;
        threadobject          *mainthread;
+       classinfo             *c;
        methodinfo            *m;
 #endif
 
        methodinfo            *m;
 #endif
 
@@ -1328,8 +1330,8 @@ bool threads_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
 
        /* set the thread */
 
 
        /* set the thread */
 
-       vmt->thread = t;
-       vmt->vmdata = (java_lang_Object *) thread;
+       LLNI_field_set_ref(vmt, thread, t);
+       LLNI_field_set_val(vmt, vmdata, (java_lang_Object *) thread);
 
 #elif defined(WITH_CLASSPATH_SUN)
 
 
 #elif defined(WITH_CLASSPATH_SUN)
 
@@ -1337,7 +1339,7 @@ bool threads_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
 
 #elif defined(WITH_CLASSPATH_CLDC1_1)
 
 
 #elif defined(WITH_CLASSPATH_CLDC1_1)
 
-       t->vm_thread = (java_lang_Object *) thread;
+       LLNI_field_set_val(t, vm_thread, (java_lang_Object *) thread);
 
 #else
 # error unknown classpath configuration
 
 #else
 # error unknown classpath configuration
@@ -1355,7 +1357,7 @@ bool threads_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
                /* get the main thread */
 
                mainthread = threads_list_first();
                /* get the main thread */
 
                mainthread = threads_list_first();
-               group = mainthread->object->group;
+               group = LLNI_field_direct(mainthread->object, group);
 #endif
        }
 
 #endif
        }
 
@@ -1380,11 +1382,13 @@ bool threads_attach_current_thread(JavaVMAttachArgs *vm_aargs, bool isdaemon)
 #if defined(ENABLE_JAVASE)
        /* store the thread group in the object */
 
 #if defined(ENABLE_JAVASE)
        /* store the thread group in the object */
 
-       thread->object->group = group;
+       LLNI_field_direct(thread->object, group) = group;
 
        /* add thread to given thread-group */
 
 
        /* add thread to given thread-group */
 
-       m = class_resolveclassmethod(group->header.vftbl->class,
+       LLNI_class_get(group, c);
+
+       m = class_resolveclassmethod(c,
                                                                 utf_addThread,
                                                                 utf_java_lang_Thread__V,
                                                                 class_java_lang_ThreadGroup,
                                                                 utf_addThread,
                                                                 utf_java_lang_Thread__V,
                                                                 class_java_lang_ThreadGroup,
@@ -1412,6 +1416,7 @@ bool threads_detach_thread(threadobject *thread)
 {
 #if defined(ENABLE_JAVASE)
        java_lang_ThreadGroup *group;
 {
 #if defined(ENABLE_JAVASE)
        java_lang_ThreadGroup *group;
+       classinfo             *c;
        methodinfo            *m;
        java_objectheader     *o;
        java_lang_Thread      *t;
        methodinfo            *m;
        java_objectheader     *o;
        java_lang_Thread      *t;
@@ -1422,19 +1427,21 @@ bool threads_detach_thread(threadobject *thread)
 #if defined(ENABLE_JAVASE)
        /* remove thread from the thread group */
 
 #if defined(ENABLE_JAVASE)
        /* remove thread from the thread group */
 
-       group = thread->object->group;
+       group = LLNI_field_direct(thread->object, group);
 
        /* XXX TWISTI: should all threads be in a ThreadGroup? */
 
        if (group != NULL) {
 
        /* XXX TWISTI: should all threads be in a ThreadGroup? */
 
        if (group != NULL) {
+               LLNI_class_get(group, c);
+
 # if defined(WITH_CLASSPATH_GNU)
 # if defined(WITH_CLASSPATH_GNU)
-               m = class_resolveclassmethod(group->header.vftbl->class,
+               m = class_resolveclassmethod(c,
                                                                         utf_removeThread,
                                                                         utf_java_lang_Thread__V,
                                                                         class_java_lang_ThreadGroup,
                                                                         true);
 # elif defined(WITH_CLASSPATH_SUN)
                                                                         utf_removeThread,
                                                                         utf_java_lang_Thread__V,
                                                                         class_java_lang_ThreadGroup,
                                                                         true);
 # elif defined(WITH_CLASSPATH_SUN)
-               m = class_resolveclassmethod(group->header.vftbl->class,
+               m = class_resolveclassmethod(c,
                                                                         utf_remove,
                                                                         utf_java_lang_Thread__V,
                                                                         class_java_lang_ThreadGroup,
                                                                         utf_remove,
                                                                         utf_java_lang_Thread__V,
                                                                         class_java_lang_ThreadGroup,
index ffd36096470101cde069bd91e27b0cd12d1b79da..6a192f0006c3847e83a05aa54dd6c915a7d69217 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: threads-common.c 8272 2007-08-08 14:55:00Z twisti $
+   $Id: threads-common.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -38,6 +38,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_String.h"
 
 #include "native/include/java_lang_Object.h"
 #include "native/include/java_lang_String.h"
@@ -407,12 +408,12 @@ bool threads_thread_start_internal(utf *name, functionptr f)
        if (vmt == NULL)
                return false;
 
        if (vmt == NULL)
                return false;
 
-       vmt->thread = object;
-       vmt->vmdata = (java_lang_Object *) t;
+       LLNI_field_set_ref(vmt, thread, object);
+       LLNI_field_set_val(vmt, vmdata, (java_lang_Object *) t);
 
 
-       object->vmThread = vmt;
+       LLNI_field_set_ref(object, vmThread, vmt);
 #elif defined(WITH_CLASSPATH_CLDC1_1)
 #elif defined(WITH_CLASSPATH_CLDC1_1)
-       object->vm_thread = (java_lang_Object *) t;
+       LLNI_field_set_val(object, vm_thread, (java_lang_Object *) t);
 #endif
 
        t->object = object;
 #endif
 
        t->object = object;
@@ -420,18 +421,18 @@ bool threads_thread_start_internal(utf *name, functionptr f)
        /* set java.lang.Thread fields */
 
 #if defined(WITH_CLASSPATH_GNU)
        /* set java.lang.Thread fields */
 
 #if defined(WITH_CLASSPATH_GNU)
-       object->name     = (java_lang_String *) javastring_new(name);
+       LLNI_field_set_ref(object, name    , (java_lang_String *) javastring_new(name));
 #elif defined(WITH_CLASSPATH_CLDC1_1)
        /* FIXME: In cldc the name is a char[] */
 #elif defined(WITH_CLASSPATH_CLDC1_1)
        /* FIXME: In cldc the name is a char[] */
-/*     object->name     = (java_chararray *) javastring_new(name); */
-       object->name     = NULL;
+/*     LLNI_field_set_ref(object, name    , (java_chararray *) javastring_new(name)); */
+       LLNI_field_set_ref(object, name    , NULL);
 #endif
 
 #if defined(ENABLE_JAVASE)
 #endif
 
 #if defined(ENABLE_JAVASE)
-       object->daemon   = true;
+       LLNI_field_set_val(object, daemon  , true);
 #endif
 
 #endif
 
-       object->priority = NORM_PRIORITY;
+       LLNI_field_set_val(object, priority, NORM_PRIORITY);
 
        /* start the thread */
 
 
        /* start the thread */
 
@@ -456,6 +457,9 @@ bool threads_thread_start_internal(utf *name, functionptr f)
 void threads_thread_start(java_lang_Thread *object)
 {
        threadobject *thread;
 void threads_thread_start(java_lang_Thread *object)
 {
        threadobject *thread;
+#if defined(WITH_CLASSPATH_GNU)
+       java_lang_VMThread *vmt;
+#endif
 
        /* Enter the join-mutex, so if the main-thread is currently
           waiting to join all threads, the number of non-daemon threads
 
        /* Enter the join-mutex, so if the main-thread is currently
           waiting to join all threads, the number of non-daemon threads
@@ -474,7 +478,7 @@ void threads_thread_start(java_lang_Thread *object)
 #if defined(ENABLE_JAVASE)
        /* is this a daemon thread? */
 
 #if defined(ENABLE_JAVASE)
        /* is this a daemon thread? */
 
-       if (object->daemon == true)
+       if (LLNI_field_direct(object, daemon) == true)
                thread->flags |= THREAD_FLAG_DAEMON;
 #endif
 
                thread->flags |= THREAD_FLAG_DAEMON;
 #endif
 
@@ -488,12 +492,14 @@ void threads_thread_start(java_lang_Thread *object)
        thread->object = object;
 
 #if defined(WITH_CLASSPATH_GNU)
        thread->object = object;
 
 #if defined(WITH_CLASSPATH_GNU)
-       assert(object->vmThread);
-       assert(object->vmThread->vmdata == NULL);
+       LLNI_field_get_ref(object, vmThread, vmt);
+
+       assert(vmt);
+       assert(LLNI_field_direct(vmt, vmdata) == NULL);
 
 
-       object->vmThread->vmdata = (java_lang_Object *) thread;
+       LLNI_field_set_val(vmt, vmdata, (java_lang_Object *) thread);
 #elif defined(WITH_CLASSPATH_CLDC1_1)
 #elif defined(WITH_CLASSPATH_CLDC1_1)
-       object->vm_thread = (java_lang_Object *) thread;
+       LLNI_field_set_val(object, vm_thread, (java_lang_Object *) thread);
 #endif
 
        /* Start the thread.  Don't pass a function pointer (NULL) since
 #endif
 
        /* Start the thread.  Don't pass a function pointer (NULL) since
@@ -524,7 +530,7 @@ void threads_thread_print_info(threadobject *t)
                /* get thread name */
 
 #if defined(WITH_CLASSPATH_GNU)
                /* get thread name */
 
 #if defined(WITH_CLASSPATH_GNU)
-               name = javastring_toutf((java_objectheader *) object->name, false);
+               name = javastring_toutf((java_objectheader *) LLNI_field_direct(object, name), false);
 #elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
                /* FIXME: In cldc the name is a char[] */
 /*             name = object->name; */
 #elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
                /* FIXME: In cldc the name is a char[] */
 /*             name = object->name; */
@@ -540,7 +546,7 @@ void threads_thread_print_info(threadobject *t)
                if (t->flags & THREAD_FLAG_DAEMON)
                        printf(" daemon");
 
                if (t->flags & THREAD_FLAG_DAEMON)
                        printf(" daemon");
 
-               printf(" prio=%d", object->priority);
+               printf(" prio=%d", LLNI_field_direct(object, priority));
 
 #if SIZEOF_VOID_P == 8
                printf(" t=0x%016lx tid=0x%016lx (%ld)",
 
 #if SIZEOF_VOID_P == 8
                printf(" t=0x%016lx tid=0x%016lx (%ld)",
index 4294bc9f3fbdf376a363cd0c6ec411d0ecd7f4ac..d898157e31edf3627682ff40a62151fecb5b755e 100644 (file)
@@ -28,7 +28,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 8277 2007-08-08 16:42:11Z michi $
+   $Id: builtin.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -55,6 +55,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/include/java_lang_String.h"
 #include "native/include/java_lang_Throwable.h"
 
 #include "native/include/java_lang_String.h"
 #include "native/include/java_lang_Throwable.h"
 
@@ -514,6 +515,7 @@ void *builtin_throw_exception(java_objectheader *xptr)
 {
 #if !defined(NDEBUG)
     java_lang_Throwable *t;
 {
 #if !defined(NDEBUG)
     java_lang_Throwable *t;
+       java_lang_String    *s;
        char                *logtext;
        s4                   logtextlen;
        s4                   dumpsize;
        char                *logtext;
        s4                   logtextlen;
        s4                   dumpsize;
@@ -521,6 +523,10 @@ void *builtin_throw_exception(java_objectheader *xptr)
        if (opt_verbose) {
                t = (java_lang_Throwable *) xptr;
 
        if (opt_verbose) {
                t = (java_lang_Throwable *) xptr;
 
+               /* get detail message */
+               if (t)
+                       LLNI_field_get_ref(t, detailMessage, s);
+
                /* calculate message length */
 
                logtextlen = strlen("Builtin exception thrown: ") + strlen("0");
                /* calculate message length */
 
                logtextlen = strlen("Builtin exception thrown: ") + strlen("0");
@@ -528,11 +534,11 @@ void *builtin_throw_exception(java_objectheader *xptr)
                if (t) {
                        logtextlen +=
                                utf_bytes(xptr->vftbl->class->name);
                if (t) {
                        logtextlen +=
                                utf_bytes(xptr->vftbl->class->name);
-                       if (t->detailMessage) {
+                       if (s) {
                                logtextlen += strlen(": ") +
                                logtextlen += strlen(": ") +
-                                       u2_utflength(t->detailMessage->value->data 
-                                                                       + t->detailMessage->offset,
-                                                        t->detailMessage->count);
+                                       u2_utflength(LLNI_field_direct(s, value)->data 
+                                                                       + LLNI_field_direct(s, offset),
+                                                        LLNI_field_direct(s,count));
                        }
                } 
                else {
                        }
                } 
                else {
@@ -550,10 +556,10 @@ void *builtin_throw_exception(java_objectheader *xptr)
                if (t) {
                        utf_cat_classname(logtext, xptr->vftbl->class->name);
 
                if (t) {
                        utf_cat_classname(logtext, xptr->vftbl->class->name);
 
-                       if (t->detailMessage) {
+                       if (s) {
                                char *buf;
 
                                char *buf;
 
-                               buf = javastring_tochar((java_objectheader *) t->detailMessage);
+                               buf = javastring_tochar((java_objectheader *) s);
                                strcat(logtext, ": ");
                                strcat(logtext, buf);
                                MFREE(buf, char, strlen(buf) + 1);
                                strcat(logtext, ": ");
                                strcat(logtext, buf);
                                MFREE(buf, char, strlen(buf) + 1);
index acedb2b18a07a6956bf217b0a3c525683a64ce85..468137629743d1de3fc423f9b6d63b8c711699da 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: exceptions.c 8283 2007-08-09 15:10:05Z twisti $
+   $Id: exceptions.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -43,6 +43,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_String.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_String.h"
@@ -466,6 +467,7 @@ static void exceptions_throw_utf_cause(utf *classname, java_objectheader *cause)
        classinfo           *c;
        java_objectheader   *o;
        methodinfo          *m;
        classinfo           *c;
        java_objectheader   *o;
        methodinfo          *m;
+       java_lang_String    *s;
        java_lang_Throwable *object;
 
        object = (java_lang_Throwable *) cause;
        java_lang_Throwable *object;
 
        object = (java_lang_Throwable *) cause;
@@ -493,7 +495,9 @@ static void exceptions_throw_utf_cause(utf *classname, java_objectheader *cause)
        if (m == NULL)
                return;
 
        if (m == NULL)
                return;
 
-       (void) vm_call_method(m, o, object->detailMessage);
+       LLNI_field_get_ref(object, detailMessage, s);
+
+       (void) vm_call_method(m, o, s);
 
        /* call initCause */
 
 
        /* call initCause */
 
@@ -1648,7 +1652,7 @@ void exceptions_classnotfoundexception_to_noclassdeffounderror(void)
        java_objectheader   *o;
        java_objectheader   *cause;
        java_lang_Throwable *object;
        java_objectheader   *o;
        java_objectheader   *cause;
        java_lang_Throwable *object;
-       java_objectheader   *s;
+       java_lang_String    *s;
 
        /* get the cause */
 
 
        /* get the cause */
 
@@ -1664,10 +1668,10 @@ void exceptions_classnotfoundexception_to_noclassdeffounderror(void)
                /* create new error */
 
                object = (java_lang_Throwable *) cause;
                /* create new error */
 
                object = (java_lang_Throwable *) cause;
-               s      = (java_objectheader *) object->detailMessage;
+               LLNI_field_get_ref(object, detailMessage, s);
 
                o = exceptions_new_utf_javastring(utf_java_lang_NoClassDefFoundError,
 
                o = exceptions_new_utf_javastring(utf_java_lang_NoClassDefFoundError,
-                                                                                 s);
+                                                                                 (java_objectheader *) s);
 
                /* we had an exception while creating the error */
 
 
                /* we had an exception while creating the error */
 
@@ -1931,6 +1935,8 @@ void exceptions_print_exception(java_objectheader *xptr)
 #if defined(ENABLE_JAVASE)
        java_lang_Throwable   *cause;
 #endif
 #if defined(ENABLE_JAVASE)
        java_lang_Throwable   *cause;
 #endif
+       java_lang_String      *s;
+       classinfo             *c;
        utf                   *u;
 
        t = (java_lang_Throwable *) xptr;
        utf                   *u;
 
        t = (java_lang_Throwable *) xptr;
@@ -1941,15 +1947,18 @@ void exceptions_print_exception(java_objectheader *xptr)
        }
 
 #if defined(ENABLE_JAVASE)
        }
 
 #if defined(ENABLE_JAVASE)
-       cause = t->cause;
+       LLNI_field_set_ref(t, cause, cause);
 #endif
 
        /* print the root exception */
 
 #endif
 
        /* print the root exception */
 
-       utf_display_printable_ascii_classname(t->header.vftbl->class->name);
+       LLNI_class_get(t, c);
+       utf_display_printable_ascii_classname(c->name);
+
+       LLNI_field_get_ref(t, detailMessage, s);
 
 
-       if (t->detailMessage != NULL) {
-               u = javastring_toutf((java_objectheader *) t->detailMessage, false);
+       if (s != NULL) {
+               u = javastring_toutf((java_objectheader *) s, false);
 
                printf(": ");
                utf_display_printable_ascii(u);
 
                printf(": ");
                utf_display_printable_ascii(u);
@@ -1962,11 +1971,14 @@ void exceptions_print_exception(java_objectheader *xptr)
 
        if ((cause != NULL) && (cause != t)) {
                printf("Caused by: ");
 
        if ((cause != NULL) && (cause != t)) {
                printf("Caused by: ");
-               utf_display_printable_ascii_classname(cause->header.vftbl->class->name);
+               
+               LLNI_class_get(cause, c);
+               utf_display_printable_ascii_classname(c->name);
 
 
-               if (cause->detailMessage != NULL) {
-                       u = javastring_toutf((java_objectheader *) cause->detailMessage,
-                                                                false);
+               LLNI_field_get_ref(cause, detailMessage, s);
+
+               if (s != NULL) {
+                       u = javastring_toutf((java_objectheader *) s, false);
 
                        printf(": ");
                        utf_display_printable_ascii(u);
 
                        printf(": ");
                        utf_display_printable_ascii(u);
index dc59d296e4a1f5aa7d65e4ef0fc8c10a330bb871..c207af31f140a6200ef739544b2aca8812b24f95 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: stacktrace.c 8139 2007-06-24 10:12:27Z twisti $
+   $Id: stacktrace.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -42,6 +42,7 @@
 
 #include "vm/global.h"                   /* required here for native includes */
 #include "native/jni.h"
 
 #include "vm/global.h"                   /* required here for native includes */
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/include/java_lang_Throwable.h"
 
 #if defined(WITH_CLASSPATH_GNU)
 #include "native/include/java_lang_Throwable.h"
 
 #if defined(WITH_CLASSPATH_GNU)
@@ -1031,8 +1032,8 @@ void stacktrace_print_trace(java_objectheader *xptr)
        /* now print the stacktrace */
 
 #if defined(WITH_CLASSPATH_GNU)
        /* now print the stacktrace */
 
 #if defined(WITH_CLASSPATH_GNU)
-       vmt = t->vmState;
-       stc = (stacktracecontainer *) vmt->vmData;
+       LLNI_field_get_ref(t, vmState, vmt);
+       stc = (stacktracecontainer *) LLNI_field_direct(vmt, vmData);
 #elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
        stc = (stacktracecontainer *) t->backtrace;
 #else
 #elif defined(WITH_CLASSPATH_SUN) || defined(WITH_CLASSPATH_CLDC1_1)
        stc = (stacktracecontainer *) t->backtrace;
 #else
index 899a9176099b4901343523719b15e9ffd44e59ed..6969a31f2b323979e3e7a57450d2e3129e73a6a3 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: string.c 8230 2007-07-25 08:23:10Z twisti $
+   $Id: string.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -38,6 +38,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 
 #include "native/include/java_lang_String.h"
 
 
 #include "native/include/java_lang_String.h"
 
@@ -120,7 +121,7 @@ void stringtable_update(void)
                                        vm_abort("stringtable_update: invalid literalstring in hashtable");
                                }
 
                                        vm_abort("stringtable_update: invalid literalstring in hashtable");
                                }
 
-                               a = js->value;
+                               LLNI_field_get_ref(js, value, a);
 
                                if (!js->header.vftbl) 
                                        /* vftbl of javastring is NULL */ 
 
                                if (!js->header.vftbl) 
                                        /* vftbl of javastring is NULL */ 
@@ -187,9 +188,9 @@ static java_objectheader *javastring_new_from_utf_buffer(const char *buffer,
 
        s = (java_lang_String *) o;
 
 
        s = (java_lang_String *) o;
 
-       s->value  = a;
-       s->offset = 0;
-       s->count  = utflength;
+       LLNI_field_set_ref(s, value , a);
+       LLNI_field_set_val(s, offset, 0);
+       LLNI_field_set_val(s, count , utflength);
 
        return o;
 }
 
        return o;
 }
@@ -247,9 +248,9 @@ java_objectheader *javastring_safe_new_from_utf8(const char *text)
 
        s = (java_lang_String *) o;
 
 
        s = (java_lang_String *) o;
 
-       s->value  = a;
-       s->offset = 0;
-       s->count  = len;
+       LLNI_field_set_ref(s, value , a);
+       LLNI_field_set_val(s, offset, 0);
+       LLNI_field_set_val(s, count , len);
 
        return o;
 }
 
        return o;
 }
@@ -321,9 +322,9 @@ java_objectheader *javastring_new(utf *u)
 
        s = (java_lang_String *) o;
 
 
        s = (java_lang_String *) o;
 
-       s->value  = a;
-       s->offset = 0;
-       s->count  = utflength;
+       LLNI_field_set_ref(s, value , a);
+       LLNI_field_set_val(s, offset, 0);
+       LLNI_field_set_val(s, count , utflength);
 
        return o;
 }
 
        return o;
 }
@@ -376,9 +377,9 @@ java_objectheader *javastring_new_slash_to_dot(utf *u)
 
        s = (java_lang_String *) o;
 
 
        s = (java_lang_String *) o;
 
-       s->value  = a;
-       s->offset = 0;
-       s->count  = utflength;
+       LLNI_field_set_ref(s, value , a);
+       LLNI_field_set_val(s, offset, 0);
+       LLNI_field_set_val(s, count , utflength);
 
        return o;
 }
 
        return o;
 }
@@ -430,9 +431,9 @@ java_objectheader *javastring_new_from_ascii(const char *text)
 
        s = (java_lang_String *) o;
 
 
        s = (java_lang_String *) o;
 
-       s->value  = a;
-       s->offset = 0;
-       s->count  = len;
+       LLNI_field_set_ref(s, value , a);
+       LLNI_field_set_val(s, offset, 0);
+       LLNI_field_set_val(s, count , len);
 
        return o;
 }
 
        return o;
 }
@@ -458,15 +459,15 @@ char *javastring_tochar(java_objectheader *so)
        if (!s)
                return "";
 
        if (!s)
                return "";
 
-       a = s->value;
+       LLNI_field_get_ref(s, value, a);
 
        if (!a)
                return "";
 
 
        if (!a)
                return "";
 
-       buf = MNEW(char, s->count + 1);
+       buf = MNEW(char, LLNI_field_direct(s, count) + 1);
 
 
-       for (i = 0; i < s->count; i++)
-               buf[i] = a->data[s->offset + i];
+       for (i = 0; i < LLNI_field_direct(s, count); i++)
+               buf[i] = a->data[LLNI_field_direct(s, offset) + i];
 
        buf[i] = '\0';
 
 
        buf[i] = '\0';
 
@@ -489,7 +490,7 @@ utf *javastring_toutf(java_objectheader *string, bool isclassname)
        if (s == NULL)
                return utf_null;
 
        if (s == NULL)
                return utf_null;
 
-       return utf_new_u2(s->value->data + s->offset, s->count, isclassname);
+       return utf_new_u2(LLNI_field_direct(s, value)->data + LLNI_field_direct(s, offset), LLNI_field_direct(s, count), isclassname);
 }
 
 
 }
 
 
index 66c845ee410efa155d9ef1b4ccd58b0b91195261..43f8c64f4b2c2ec4771c6e077dd641f95cb650b7 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: vm.c 8270 2007-08-08 13:57:12Z twisti $
+   $Id: vm.c 8284 2007-08-10 08:58:39Z michi $
 
 */
 
 
 */
 
@@ -50,6 +50,7 @@
 #include "mm/memory.h"
 
 #include "native/jni.h"
 #include "mm/memory.h"
 
 #include "native/jni.h"
+#include "native/llni.h"
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"             /* required by j.l.C */
 #include "native/native.h"
 
 #include "native/include/java_lang_Object.h"             /* required by j.l.C */
@@ -2757,41 +2758,41 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o,
                        switch (td->decltype) {
                        case PRIMITIVETYPE_BOOLEAN:
                                if (c == class_java_lang_Boolean)
                        switch (td->decltype) {
                        case PRIMITIVETYPE_BOOLEAN:
                                if (c == class_java_lang_Boolean)
-                                       value.i = ((java_lang_Boolean *) param)->value;
+                                       LLNI_field_get_val((java_lang_Boolean *) param, value, value.i);
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_BYTE:
                                if (c == class_java_lang_Byte)
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_BYTE:
                                if (c == class_java_lang_Byte)
-                                       value.i = ((java_lang_Byte *) param)->value;
+                                       LLNI_field_get_val((java_lang_Byte *) param, value, value.i);
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_CHAR:
                                if (c == class_java_lang_Character)
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_CHAR:
                                if (c == class_java_lang_Character)
-                                       value.i = ((java_lang_Character *) param)->value;
+                                       LLNI_field_get_val((java_lang_Character *) param, value, value.i);
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_SHORT:
                                if (c == class_java_lang_Short)
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_SHORT:
                                if (c == class_java_lang_Short)
-                                       value.i = ((java_lang_Short *) param)->value;
+                                       LLNI_field_get_val((java_lang_Short *) param, value, value.i);
                                else if (c == class_java_lang_Byte)
                                else if (c == class_java_lang_Byte)
-                                       value.i = ((java_lang_Byte *) param)->value;
+                                       LLNI_field_get_val((java_lang_Byte *) param, value, value.i);
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_INT:
                                if (c == class_java_lang_Integer)
                                else
                                        goto illegal_arg;
                                break;
 
                        case PRIMITIVETYPE_INT:
                                if (c == class_java_lang_Integer)
-                                       value.i = ((java_lang_Integer *) param)->value;
+                                       LLNI_field_get_val((java_lang_Integer *) param, value, value.i);
                                else if (c == class_java_lang_Short)
                                else if (c == class_java_lang_Short)
-                                       value.i = ((java_lang_Short *) param)->value;
+                                       LLNI_field_get_val((java_lang_Short *) param, value, value.i);
                                else if (c == class_java_lang_Byte)
                                else if (c == class_java_lang_Byte)
-                                       value.i = ((java_lang_Byte *) param)->value;
+                                       LLNI_field_get_val((java_lang_Byte *) param, value, value.i);
                                else
                                        goto illegal_arg;
                                break;
                                else
                                        goto illegal_arg;
                                break;
@@ -2814,13 +2815,13 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o,
                        switch (td->decltype) {
                        case PRIMITIVETYPE_LONG:
                                if (c == class_java_lang_Long)
                        switch (td->decltype) {
                        case PRIMITIVETYPE_LONG:
                                if (c == class_java_lang_Long)
-                                       value.l = ((java_lang_Long *) param)->value;
+                                       LLNI_field_get_val((java_lang_Long *) param, value, value.l);
                                else if (c == class_java_lang_Integer)
                                else if (c == class_java_lang_Integer)
-                                       value.l = (int64_t) ((java_lang_Integer *) param)->value;
+                                       value.l = (int64_t) LLNI_field_direct(((java_lang_Integer *) param), value);
                                else if (c == class_java_lang_Short)
                                else if (c == class_java_lang_Short)
-                                       value.l = (int64_t) ((java_lang_Short *) param)->value;
+                                       value.l = (int64_t) LLNI_field_direct(((java_lang_Short *) param), value);
                                else if (c == class_java_lang_Byte)
                                else if (c == class_java_lang_Byte)
-                                       value.l = (int64_t) ((java_lang_Byte *) param)->value;
+                                       value.l = (int64_t) LLNI_field_direct(((java_lang_Byte *) param), value);
                                else
                                        goto illegal_arg;
                                break;
                                else
                                        goto illegal_arg;
                                break;
@@ -2843,7 +2844,7 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o,
                        switch (td->decltype) {
                        case PRIMITIVETYPE_FLOAT:
                                if (c == class_java_lang_Float)
                        switch (td->decltype) {
                        case PRIMITIVETYPE_FLOAT:
                                if (c == class_java_lang_Float)
-                                       value.f = ((java_lang_Float *) param)->value;
+                                       LLNI_field_get_val((java_lang_Float *) param, value, value.f);
                                else
                                        goto illegal_arg;
                                break;
                                else
                                        goto illegal_arg;
                                break;
@@ -2866,9 +2867,9 @@ uint64_t *vm_array_from_objectarray(methodinfo *m, java_objectheader *o,
                        switch (td->decltype) {
                        case PRIMITIVETYPE_DOUBLE:
                                if (c == class_java_lang_Double)
                        switch (td->decltype) {
                        case PRIMITIVETYPE_DOUBLE:
                                if (c == class_java_lang_Double)
-                                       value.d = ((java_lang_Double *) param)->value;
+                                       LLNI_field_get_val((java_lang_Double *) param, value, value.d);
                                else if (c == class_java_lang_Float)
                                else if (c == class_java_lang_Float)
-                                       value.f = ((java_lang_Float *) param)->value;
+                                       LLNI_field_get_val((java_lang_Float *) param, value, value.f);
                                else
                                        goto illegal_arg;
                                break;
                                else
                                        goto illegal_arg;
                                break;