* configure.ac (AC_CHECK_ENABLE_ASSERTION): Added
[cacao.git] / src / native / jni.h
index 693f1e3de3e21ac52a14d2631011f54b1952ba69..05a013659d12f8a74c0041aa7cff4d89f3ccbece 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jni.h 7921 2007-05-20 23:14:11Z michi $
-
 */
 
 
 
 #include "config.h"
 
-#include CLASSPATH_JNI_H
+/* XXX quick hack to not include GCJ's jni_md.h */
+#define __GCJ_JNI_MD_H__
 
+#include CLASSPATH_JNI_MD_H
+#include CLASSPATH_JNI_H
 
 #ifndef _JNI_H
 #define _JNI_H
 
-/* forward typedefs ***********************************************************/
-
-typedef struct localref_table localref_table;
-
 
 #include "vm/types.h"
 
@@ -66,7 +63,7 @@ typedef struct localref_table localref_table;
 typedef struct _Jv_JNIEnv _Jv_JNIEnv;
 
 struct _Jv_JNIEnv {
-       const struct JNINativeInterface *env;     /* This MUST be the first entry */
+       const struct JNINativeInterface_ *env;    /* This MUST be the first entry */
 };
 
 
@@ -75,7 +72,7 @@ struct _Jv_JNIEnv {
 typedef struct _Jv_JavaVM _Jv_JavaVM;
 
 struct _Jv_JavaVM {
-       const struct JNIInvokeInterface *functions;/* This MUST be the first entry*/
+       const struct JNIInvokeInterface_ *functions;/*This MUST be the first entry*/
 
        /* JVM instance-specific variables */
 
@@ -86,43 +83,13 @@ struct _Jv_JavaVM {
        s4 java_lang_management_ThreadMXBean_PeakThreadCount;
        s4 java_lang_management_ThreadMXBean_ThreadCount;
        s8 java_lang_management_ThreadMXBean_TotalStartedThreadCount;
-       s4 Java_java_lang_VMClassLoader_defaultAssertionStatus;
 };
 
 
 /* CACAO related stuff ********************************************************/
 
-extern const struct JNIInvokeInterface _Jv_JNIInvokeInterface;
-extern struct JNINativeInterface _Jv_JNINativeInterface;
-
-
-/* local reference table ******************************************************/
-
-#define LOCALREFTABLE_CAPACITY    16
-
-/* localref_table **************************************************************
-
-   ATTENTION: keep this structure a multiple of 8-bytes!!! This is
-   essential for the native stub on 64-bit architectures.
-
-*******************************************************************************/
-
-struct localref_table {
-       s4                 capacity;        /* table size                         */
-       s4                 used;            /* currently used references          */
-       s4                 localframes;     /* number of current frames           */
-       s4                 PADDING;         /* 8-byte padding                     */
-       localref_table    *prev;            /* link to prev table (LocalFrame)    */
-       java_objectheader *refs[LOCALREFTABLE_CAPACITY]; /* references            */
-};
-
-#if defined(ENABLE_THREADS)
-#define LOCALREFTABLE    (THREADOBJECT->_localref_table)
-#else
-extern localref_table *_no_threads_localref_table;
-
-#define LOCALREFTABLE    (_no_threads_localref_table)
-#endif
+extern const struct JNIInvokeInterface_ _Jv_JNIInvokeInterface;
+extern struct JNINativeInterface_ _Jv_JNINativeInterface;
 
 
 /* hashtable_global_ref_entry *************************************************/
@@ -130,7 +97,7 @@ extern localref_table *_no_threads_localref_table;
 typedef struct hashtable_global_ref_entry hashtable_global_ref_entry;
 
 struct hashtable_global_ref_entry {
-       java_objectheader          *o;      /* object pointer of global ref       */
+       java_object_t              *o;      /* object pointer of global ref       */
        s4                          refs;   /* references of the current pointer  */
        hashtable_global_ref_entry *hashlink; /* link for external chaining       */
 };
@@ -138,12 +105,11 @@ struct hashtable_global_ref_entry {
 
 /* function prototypes ********************************************************/
 
-/* initialize JNI subsystem */
 bool jni_init(void);
-bool jni_init_localref_table(void);
+bool jni_version_check(int version);
 
-java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
-                                                                               java_objectarray *params);
+java_handle_t *_Jv_jni_invokeNative(methodinfo *m, java_handle_t *o,
+                                                                       java_handle_objectarray_t *params);
 
 #endif /* _JNI_H */