* src/native/vm/java_lang_ClassLoader.c [ENABLE_STATISTICS]
[cacao.git] / src / native / jni.h
index aa6a8af9e4a81c1a32eee67a7ef540ca72c34d5c..0c14db8e229fe28cfd053a14fea185daf68beb05 100644 (file)
@@ -1,6 +1,6 @@
-/* native/jni.h - JNI types and data structures
+/* src/native/jni.h - JNI types and data structures
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 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
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
+   $Id: jni.h 7246 2007-01-29 18:49:05Z twisti $
 
-   Authors: Reinhard Grafl
-            Roman Obermaisser
+*/
 
-   Changes: Christian Thalinger
 
-   $Id: jni.h 4913 2006-05-14 14:02:51Z edwin $
+/* GNU Classpath jni.h *********************************************************
 
-*/
+   ATTENTION: We include this file before we actually define our own
+   jni.h.  We do this because, otherwise we can get into unresolvable
+   circular header dependencies.
+
+   This is OK as GNU Classpath defines:
+
+   #define _CLASSPATH_JNI_H
+
+   CLASSPATH_JNI_H is in config.h defined.
+
+*******************************************************************************/
+
+#include "config.h"
+
+#include CLASSPATH_JNI_H
 
 
 #ifndef _JNI_H
 #define _JNI_H
 
-#include "config.h"
-#include "vm/types.h"
+/* forward typedefs ***********************************************************/
 
-#include "vm/global.h"
-#include "vm/method.h"
+typedef struct localref_table localref_table;
 
 
-/* Include the JNI header from GNU Classpath **********************************/
+#include "vm/types.h"
 
-#include CLASSPATH_JNI_H
+#include "vm/global.h"
+
+#include "vmcore/method.h"
 
 
 /* _Jv_JNIEnv *****************************************************************/
@@ -64,6 +76,17 @@ typedef struct _Jv_JavaVM _Jv_JavaVM;
 
 struct _Jv_JavaVM {
        const struct JNIInvokeInterface *functions;/* This MUST be the first entry*/
+
+       /* JVM instance-specific variables */
+
+       s8 starttime;                       /* VM startup time                    */
+
+       s4 Java_gnu_java_lang_management_VMClassLoadingMXBeanImpl_verbose;
+       s4 Java_gnu_java_lang_management_VMMemoryMXBeanImpl_verbose;
+       s4 java_lang_management_ThreadMXBean_PeakThreadCount;
+       s4 java_lang_management_ThreadMXBean_ThreadCount;
+       s8 java_lang_management_ThreadMXBean_TotalStartedThreadCount;
+       s4 Java_java_lang_VMClassLoader_defaultAssertionStatus;
 };
 
 
@@ -77,8 +100,6 @@ extern struct JNINativeInterface _Jv_JNINativeInterface;
 
 #define LOCALREFTABLE_CAPACITY    16
 
-typedef struct localref_table localref_table;
-
 /* localref_table **************************************************************
 
    ATTENTION: keep this structure a multiple of 8-bytes!!! This is
@@ -95,7 +116,7 @@ struct localref_table {
        java_objectheader *refs[LOCALREFTABLE_CAPACITY]; /* references            */
 };
 
-#if defined(USE_THREADS)
+#if defined(ENABLE_THREADS)
 #define LOCALREFTABLE    (THREADOBJECT->_localref_table)
 #else
 extern localref_table *_no_threads_localref_table;
@@ -119,6 +140,7 @@ struct hashtable_global_ref_entry {
 
 /* initialize JNI subsystem */
 bool jni_init(void);
+bool jni_init_localref_table(void);
 
 java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
                                                                                java_objectarray *params);