1 /* src/vm/jit/asmpart.h - prototypes for machine specfic functions
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: asmpart.h 7216 2007-01-16 09:54:47Z twisti $
37 #if defined(ENABLE_THREADS)
38 # include "threads/native/threads.h"
39 # include "threads/native/critical.h"
42 #include "vm/global.h"
43 #include "vm/linker.h"
44 #include "vm/resolve.h"
46 #include "vm/jit/replace.h"
47 #include "vm/jit/stacktrace.h"
50 /* some macros ****************************************************************/
52 #if defined(ENABLE_JIT)
53 # if defined(ENABLE_INTRP)
55 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
58 intrp_asm_getclassvalues_atomic((super), (sub), (out)); \
60 asm_getclassvalues_atomic((super), (sub), (out)); \
63 # else /* defined(ENABLE_INTRP) */
65 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
66 asm_getclassvalues_atomic((super), (sub), (out))
68 # endif /* defined(ENABLE_INTRP) */
70 #else /* defined(ENABLE_JIT) */
72 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
73 intrp_asm_getclassvalues_atomic((super), (sub), (out))
75 #endif /* defined(ENABLE_JIT) */
78 typedef struct castinfo castinfo;
87 /* function prototypes ********************************************************/
89 /* machine dependent initialization */
93 invokes the compiler for untranslated JavaVM methods.
94 Register R0 contains a pointer to the method info structure
95 (prepared by createcompilerstub).
97 void asm_call_jit_compiler(void);
99 #if defined(ENABLE_JIT)
100 java_objectheader *asm_vm_call_method(methodinfo *m, s4 vmargscount,
103 s4 asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
104 s8 asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
105 float asm_vm_call_method_float(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
106 double asm_vm_call_method_double(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
108 void asm_vm_call_method_exception_handler(void);
111 #if defined(ENABLE_INTRP)
112 java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount,
115 s4 intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount,
117 s8 intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount,
119 float intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount,
121 double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
125 /* exception handling functions */
127 #if defined(ENABLE_JIT)
128 void asm_handle_exception(void);
129 void asm_handle_nat_exception(void);
132 /* stub for throwing AbstractMethodError's */
133 #if defined(ENABLE_JIT)
134 void asm_abstractmethoderror(void);
137 #if defined(ENABLE_INTRP)
138 void intrp_asm_abstractmethoderror(void);
141 /* wrapper for code patching functions */
142 void asm_patcher_wrapper(void);
144 /* functions for on-stack replacement */
145 #if defined(ENABLE_REPLACEMENT)
146 void asm_replacement_out(void);
147 void asm_replacement_in(executionstate_t *es, replace_safestack_t *st);
150 long asm_compare_and_swap(volatile long *p, long oldval, long newval);
151 void asm_memory_barrier(void);
153 #if defined(ENABLE_THREADS)
154 extern critical_section_node_t asm_criticalsections;
157 #if defined(ENABLE_JIT)
158 void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
161 #if defined(ENABLE_INTRP)
162 void intrp_asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
165 /* cache flush function */
166 void asm_cacheflush(u1 *addr, s4 nbytes);
168 u8 asm_get_cycle_count(void);
170 #endif /* _ASMPART_H */
174 * These are local overrides for various environment variables in Emacs.
175 * Please do not remove this and leave it at the end of the file, where
176 * Emacs will automagically detect them.
177 * ---------------------------------------------------------------------
180 * indent-tabs-mode: t
184 * vim:noexpandtab:sw=4:ts=4: