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 7596 2007-03-28 21:05:53Z twisti $
36 #if defined(ENABLE_THREADS)
37 # include "threads/critical.h"
40 #include "vm/global.h"
43 #include "vm/jit/replace.h"
45 #include "vmcore/linker.h"
48 /* some macros ****************************************************************/
50 #if defined(ENABLE_JIT)
51 # if defined(ENABLE_INTRP)
53 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
56 intrp_asm_getclassvalues_atomic((super), (sub), (out)); \
58 asm_getclassvalues_atomic((super), (sub), (out)); \
61 # else /* defined(ENABLE_INTRP) */
63 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
64 asm_getclassvalues_atomic((super), (sub), (out))
66 # endif /* defined(ENABLE_INTRP) */
68 #else /* defined(ENABLE_JIT) */
70 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
71 intrp_asm_getclassvalues_atomic((super), (sub), (out))
73 #endif /* defined(ENABLE_JIT) */
76 /* function prototypes ********************************************************/
78 /* machine dependent initialization */
82 invokes the compiler for untranslated JavaVM methods.
83 Register R0 contains a pointer to the method info structure
84 (prepared by createcompilerstub).
86 void asm_call_jit_compiler(void);
88 #if defined(ENABLE_JIT)
89 java_objectheader *asm_vm_call_method(methodinfo *m, s4 vmargscount,
92 s4 asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
93 s8 asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
94 float asm_vm_call_method_float(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
95 double asm_vm_call_method_double(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
97 void asm_vm_call_method_exception_handler(void);
99 /* asm_vm_call_method_end is a dummy symbol marking the end of the asm_vm_call_method
100 * function and is used to insert the coderange into the avl tree.
102 void asm_vm_call_method_end(void);
105 #if defined(ENABLE_INTRP)
106 java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount,
109 s4 intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount,
111 s8 intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount,
113 float intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount,
115 double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
119 /* exception handling functions */
121 #if defined(ENABLE_JIT)
122 void asm_handle_exception(void);
123 void asm_handle_nat_exception(void);
126 /* stub for throwing AbstractMethodError's */
127 #if defined(ENABLE_JIT)
128 void asm_abstractmethoderror(void);
131 #if defined(ENABLE_INTRP)
132 void intrp_asm_abstractmethoderror(void);
135 /* wrapper for code patching functions */
136 void asm_patcher_wrapper(void);
138 /* functions for on-stack replacement */
139 #if defined(ENABLE_REPLACEMENT)
140 void asm_replacement_out(void);
141 void asm_replacement_in(executionstate_t *es, replace_safestack_t *st);
144 long asm_compare_and_swap(volatile long *p, long oldval, long newval);
145 void asm_memory_barrier(void);
147 #if defined(ENABLE_THREADS)
148 extern critical_section_node_t asm_criticalsections;
151 #if defined(ENABLE_JIT)
152 void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
155 #if defined(ENABLE_INTRP)
156 void intrp_asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
159 /* cache flush function */
160 void asm_cacheflush(u1 *addr, s4 nbytes);
162 u8 asm_get_cycle_count(void);
164 #endif /* _ASMPART_H */
168 * These are local overrides for various environment variables in Emacs.
169 * Please do not remove this and leave it at the end of the file, where
170 * Emacs will automagically detect them.
171 * ---------------------------------------------------------------------
174 * indent-tabs-mode: t
178 * vim:noexpandtab:sw=4:ts=4: