1 /* src/native/jni.h - JNI types and data structures
3 Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 $Id: jni.h 8132 2007-06-22 11:15:47Z twisti $
30 /* GNU Classpath jni.h *********************************************************
32 ATTENTION: We include this file before we actually define our own
33 jni.h. We do this because, otherwise we can get into unresolvable
34 circular header dependencies.
36 This is OK as GNU Classpath defines:
38 #define _CLASSPATH_JNI_H
40 CLASSPATH_JNI_H is in config.h defined.
42 *******************************************************************************/
46 /* XXX quick hack to not include GCJ's jni_md.h */
47 #define __GCJ_JNI_MD_H__
49 #include CLASSPATH_JNI_MD_H
50 #include CLASSPATH_JNI_H
55 /* forward typedefs ***********************************************************/
57 typedef struct localref_table localref_table;
62 #include "vm/global.h"
64 #include "vmcore/method.h"
67 /* _Jv_JNIEnv *****************************************************************/
69 typedef struct _Jv_JNIEnv _Jv_JNIEnv;
72 const struct JNINativeInterface_ *env; /* This MUST be the first entry */
76 /* _Jv_JavaVM *****************************************************************/
78 typedef struct _Jv_JavaVM _Jv_JavaVM;
81 const struct JNIInvokeInterface_ *functions;/*This MUST be the first entry*/
83 /* JVM instance-specific variables */
85 s8 starttime; /* VM startup time */
87 s4 Java_gnu_java_lang_management_VMClassLoadingMXBeanImpl_verbose;
88 s4 Java_gnu_java_lang_management_VMMemoryMXBeanImpl_verbose;
89 s4 java_lang_management_ThreadMXBean_PeakThreadCount;
90 s4 java_lang_management_ThreadMXBean_ThreadCount;
91 s8 java_lang_management_ThreadMXBean_TotalStartedThreadCount;
92 s4 Java_java_lang_VMClassLoader_defaultAssertionStatus;
96 /* CACAO related stuff ********************************************************/
98 extern const struct JNIInvokeInterface_ _Jv_JNIInvokeInterface;
99 extern struct JNINativeInterface_ _Jv_JNINativeInterface;
102 /* local reference table ******************************************************/
104 #define LOCALREFTABLE_CAPACITY 16
106 /* localref_table **************************************************************
108 ATTENTION: keep this structure a multiple of 8-bytes!!! This is
109 essential for the native stub on 64-bit architectures.
111 *******************************************************************************/
113 struct localref_table {
114 s4 capacity; /* table size */
115 s4 used; /* currently used references */
116 s4 localframes; /* number of current frames */
117 s4 PADDING; /* 8-byte padding */
118 localref_table *prev; /* link to prev table (LocalFrame) */
119 java_objectheader *refs[LOCALREFTABLE_CAPACITY]; /* references */
122 #if defined(ENABLE_THREADS)
123 #define LOCALREFTABLE (THREADOBJECT->_localref_table)
125 extern localref_table *_no_threads_localref_table;
127 #define LOCALREFTABLE (_no_threads_localref_table)
131 /* hashtable_global_ref_entry *************************************************/
133 typedef struct hashtable_global_ref_entry hashtable_global_ref_entry;
135 struct hashtable_global_ref_entry {
136 java_objectheader *o; /* object pointer of global ref */
137 s4 refs; /* references of the current pointer */
138 hashtable_global_ref_entry *hashlink; /* link for external chaining */
142 /* function prototypes ********************************************************/
144 /* initialize JNI subsystem */
146 bool jni_init_localref_table(void);
148 java_objectheader *_Jv_jni_invokeNative(methodinfo *m, java_objectheader *o,
149 java_objectarray *params);
155 * These are local overrides for various environment variables in Emacs.
156 * Please do not remove this and leave it at the end of the file, where
157 * Emacs will automagically detect them.
158 * ---------------------------------------------------------------------
161 * indent-tabs-mode: t