* src/vm/jit/i386/Makefile.am (DIST_SUBDIRS): Added solaris.
[cacao.git] / src / vm / vm.h
1 /* src/vm/vm.h - basic JVM functions
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _VM_H
27 #define _VM_H
28
29 #include "config.h"
30
31 #include <stdarg.h>
32 #include <stdint.h>
33
34 #include "vm/types.h"
35
36 #include "native/jni.h"
37
38 #include "vm/global.h"
39
40 #include "vmcore/class.h"
41 #include "vmcore/method.h"
42
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /* export global variables ****************************************************/
48
49 extern _Jv_JavaVM *_Jv_jvm;
50 extern _Jv_JNIEnv *_Jv_env;
51
52 extern bool vm_initializing;
53 extern bool vm_created;
54 extern bool vm_exiting;
55
56 #if defined(ENABLE_INTRP)
57 extern u1 *intrp_main_stack;
58 #endif
59
60
61 /* function prototypes ********************************************************/
62
63 void usage(void);
64
65 bool vm_createjvm(JavaVM **p_vm, void **p_env, void *vm_args);
66 bool vm_create(JavaVMInitArgs *vm_args);
67 void vm_run(JavaVM *vm, JavaVMInitArgs *vm_args);
68 s4   vm_destroy(JavaVM *vm);
69 void vm_exit(s4 status);
70 void vm_shutdown(s4 status);
71
72 void vm_exit_handler(void);
73
74 void vm_abort(const char *text, ...);
75 void vm_abort_errnum(int errnum, const char *text, ...);
76 void vm_abort_errno(const char *text, ...);
77 void vm_abort_disassemble(void *pc, int count, const char *text, ...);
78
79 /* Java method calling functions */
80
81 java_handle_t *vm_call_method(methodinfo *m, java_handle_t *o, ...);
82 java_handle_t *vm_call_method_valist(methodinfo *m, java_handle_t *o,
83                                                                                  va_list ap);
84 java_handle_t *vm_call_method_jvalue(methodinfo *m, java_handle_t *o,
85                                                                                  const jvalue *args);
86
87 int32_t vm_call_method_int(methodinfo *m, java_handle_t *o, ...);
88 int32_t vm_call_method_int_valist(methodinfo *m, java_handle_t *o, va_list ap);
89 int32_t vm_call_method_int_jvalue(methodinfo *m, java_handle_t *o, const jvalue *args);
90
91 int64_t vm_call_method_long(methodinfo *m, java_handle_t *o, ...);
92 int64_t vm_call_method_long_valist(methodinfo *m, java_handle_t *o, va_list ap);
93 int64_t vm_call_method_long_jvalue(methodinfo *m, java_handle_t *o, const jvalue *args);
94
95 float   vm_call_method_float(methodinfo *m, java_handle_t *o, ...);
96 float   vm_call_method_float_valist(methodinfo *m, java_handle_t *o, va_list ap);
97 float   vm_call_method_float_jvalue(methodinfo *m, java_handle_t *o, const jvalue *args);
98
99 double  vm_call_method_double(methodinfo *m, java_handle_t *o, ...);
100 double  vm_call_method_double_valist(methodinfo *m, java_handle_t *o, va_list ap);
101 double  vm_call_method_double_jvalue(methodinfo *m, java_handle_t *o, const jvalue *args);
102
103 java_handle_t *vm_call_method_objectarray(methodinfo *m, java_handle_t *o, java_handle_objectarray_t *params);
104
105 #ifdef __cplusplus
106 }
107 #endif
108
109 #endif /* _VM_H */
110
111
112 /*
113  * These are local overrides for various environment variables in Emacs.
114  * Please do not remove this and leave it at the end of the file, where
115  * Emacs will automagically detect them.
116  * ---------------------------------------------------------------------
117  * Local variables:
118  * mode: c
119  * indent-tabs-mode: t
120  * c-basic-offset: 4
121  * tab-width: 4
122  * End:
123  * vim:noexpandtab:sw=4:ts=4:
124  */