* Moved all files from vmcore/ to vm/.
[cacao.git] / src / vm / jit / asmpart.h
1 /* src/vm/jit/asmpart.h - prototypes for machine specfic 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 _ASMPART_H
27 #define _ASMPART_H
28
29 #include "config.h"
30
31 #include <stdint.h>
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include "vm/types.h"
38
39 #include "vm/global.h"
40 #include "vm/linker.h"
41 #include "vm/vm.hpp"
42
43
44 /* function prototypes ********************************************************/
45
46 /* machine dependent initialization */
47 s4   asm_md_init(void);
48
49 #if !defined(JIT_COMPILER_VIA_SIGNAL)
50 /* 
51    invokes the compiler for untranslated JavaVM methods.
52    Register R0 contains a pointer to the method info structure
53    (prepared by createcompilerstub).
54 */
55 void asm_call_jit_compiler(void);
56 #endif
57
58 #if defined(ENABLE_JIT)
59 java_object_t *asm_vm_call_method(void *pv, uint64_t *array, int32_t stackargs);
60 int32_t        asm_vm_call_method_int(void *pv, uint64_t *array, int32_t stackargs);
61
62 int64_t        asm_vm_call_method_long(void *pv, uint64_t *array, int32_t stackargs);
63 float          asm_vm_call_method_float(void *pv, uint64_t *array, int32_t stackargs);
64 double         asm_vm_call_method_double(void *pv, uint64_t *array, int32_t stackargs);
65
66 void   asm_vm_call_method_exception_handler(void);
67 void   asm_vm_call_method_end(void);
68 #endif
69
70 #if defined(ENABLE_INTRP)
71 java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount,
72                                                                                         vm_arg *vmargs);
73
74 s4     intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount,
75                                                                         vm_arg *vmargs);
76 s8     intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount,
77                                                                          vm_arg *vmargs);
78 float  intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount,
79                                                                           vm_arg *vmargs);
80 double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
81                                                                            vm_arg *vmargs);
82 #endif
83
84 /* exception handling functions */
85
86 #if defined(ENABLE_JIT)
87 void asm_handle_exception(void);
88 void asm_handle_nat_exception(void);
89 #endif
90
91 /* stub for throwing AbstractMethodError's */
92 #if defined(ENABLE_JIT)
93 void asm_abstractmethoderror(void);
94 #endif
95
96 #if defined(ENABLE_INTRP)
97 void intrp_asm_abstractmethoderror(void);
98 #endif
99
100 /* wrapper for code patching functions */
101 void asm_patcher_wrapper(void);
102
103 /* cache flush function */
104 void asm_cacheflush(void* addr, int nbytes);
105
106 u8 asm_get_cycle_count(void);
107
108 void *md_asm_codegen_get_pv_from_pc(void *ra);
109
110 #if defined(ENABLE_ESCAPE_CHECK)
111 void asm_escape_check(java_object_t *obj);
112 #endif
113
114 #ifdef __cplusplus
115 }
116 #endif
117
118 #endif /* _ASMPART_H */
119
120
121 /*
122  * These are local overrides for various environment variables in Emacs.
123  * Please do not remove this and leave it at the end of the file, where
124  * Emacs will automagically detect them.
125  * ---------------------------------------------------------------------
126  * Local variables:
127  * mode: c
128  * indent-tabs-mode: t
129  * c-basic-offset: 4
130  * tab-width: 4
131  * End:
132  * vim:noexpandtab:sw=4:ts=4:
133  */