4217b2ea73a05ce80cfbc8124aa17a12e1ba9add
[cacao.git] / src / vm / vm.h
1 /* src/vm/vm.h - basic JVM functions
2
3    Copyright (C) 1996-2005, 2006 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
7
8    This file is part of CACAO.
9
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.
14
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.
19
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
23    02110-1301, USA.
24
25    Contact: cacao@cacaojvm.org
26
27    Authors: Christian Thalinger
28
29    Changes:
30
31    $Id: finalizer.c 4357 2006-01-22 23:33:38Z twisti $
32
33 */
34
35
36 #ifndef _VM_H
37 #define _VM_H
38
39 #include "config.h"
40 #include "vm/types.h"
41
42 #include "native/jni.h"
43 #include "vm/global.h"
44
45
46 /* export global variables ****************************************************/
47
48 extern _Jv_JNIEnv *_Jv_env;
49
50 extern bool vm_initializing;
51 extern bool vm_exiting;
52
53 extern u1 *intrp_main_stack;
54
55 extern void **stackbottom;
56
57 extern char *mainstring;
58 extern classinfo *mainclass;
59
60
61 /* vm_arg **********************************************************************
62
63    Datastructure for arguments to call Java methods via vm_call_method
64    functions.
65
66 *******************************************************************************/
67
68 typedef struct vm_arg vm_arg;
69
70 struct vm_arg {
71         u8 type;
72         u8 data;
73 };
74
75
76 /* function prototypes ********************************************************/
77
78 void usage(void);
79
80 bool vm_create(JavaVMInitArgs *vm_args);
81 s4   vm_destroy(JavaVM *vm);
82 void vm_exit(s4 status);
83 void vm_shutdown(s4 status);
84
85 void vm_exit_handler(void);
86
87 /* Java method calling functions */
88 java_objectheader *vm_call_method_intern(methodinfo *m, void *a0, void *a1,
89                                                                                  void *a2, void *a3);
90
91 s4 vm_call_method_intern_int(methodinfo *m, void *a0, void *a1, void *a2,
92                                                          void *a3);
93
94 java_objectheader *vm_call_method(methodinfo *m, u4 count, vm_arg *vmargs);
95 s4     vm_call_method_int(methodinfo *m, u4 count, vm_arg *vmargs);
96 s8     vm_call_method_long(methodinfo *m, u4 count, vm_arg *vmargs);
97 float  vm_call_method_float(methodinfo *m, u4 count, vm_arg *vmargs);
98 double vm_call_method_double(methodinfo *m, u4 count, vm_arg *vmargs);
99
100 #endif /* _VM_H */
101
102 /*
103  * These are local overrides for various environment variables in Emacs.
104  * Please do not remove this and leave it at the end of the file, where
105  * Emacs will automagically detect them.
106  * ---------------------------------------------------------------------
107  * Local variables:
108  * mode: c
109  * indent-tabs-mode: t
110  * c-basic-offset: 4
111  * tab-width: 4
112  * End:
113  */