1 /* src/vm/jit/asmpart.h - prototypes for machine specfic functions
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
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 Contact: cacao@cacaojvm.org
27 Authors: Reinhard Grafl
30 Changes: Christian Thalinger
33 $Id: asmpart.h 4920 2006-05-15 13:13:22Z twisti $
45 #if defined(USE_THREADS)
46 # if defined(NATIVE_THREADS)
47 # include "threads/native/threads.h"
48 # include "threads/native/critical.h"
50 # include "threads/green/threads.h"
54 #include "vm/global.h"
55 #include "vm/linker.h"
56 #include "vm/resolve.h"
58 #include "vm/jit/replace.h"
59 #include "vm/jit/stacktrace.h"
62 /* some macros ****************************************************************/
64 #if defined(ENABLE_JIT)
65 # if defined(ENABLE_INTRP)
67 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
70 intrp_asm_getclassvalues_atomic((super), (sub), (out)); \
72 asm_getclassvalues_atomic((super), (sub), (out)); \
75 # else /* defined(ENABLE_INTRP) */
77 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
78 asm_getclassvalues_atomic((super), (sub), (out))
80 # endif /* defined(ENABLE_INTRP) */
82 #else /* defined(ENABLE_JIT) */
84 # define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
85 intrp_asm_getclassvalues_atomic((super), (sub), (out))
87 #endif /* defined(ENABLE_JIT) */
90 typedef struct castinfo castinfo;
99 /* function prototypes ********************************************************/
101 /* machine dependent initialization */
102 s4 asm_md_init(void);
105 invokes the compiler for untranslated JavaVM methods.
106 Register R0 contains a pointer to the method info structure
107 (prepared by createcompilerstub).
109 void asm_call_jit_compiler(void);
111 #if defined(ENABLE_JIT)
112 java_objectheader *asm_vm_call_method(methodinfo *m, s4 vmargscount,
115 s4 asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
116 s8 asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
117 float asm_vm_call_method_float(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
118 double asm_vm_call_method_double(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
120 void asm_vm_call_method_exception_handler(void);
123 #if defined(ENABLE_INTRP)
124 java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount,
127 s4 intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount,
129 s8 intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount,
131 float intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount,
133 double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
137 /* exception handling functions */
139 #if defined(ENABLE_JIT)
140 void asm_handle_exception(void);
141 void asm_handle_nat_exception(void);
144 /* wrapper for code patching functions */
145 void asm_wrapper_patcher(void);
147 /* functions for on-stack replacement */
148 void asm_replacement_out(void);
149 void asm_replacement_in(executionstate *es);
151 void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
153 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
154 extern critical_section_node_t asm_criticalsections;
158 #if defined(ENABLE_JIT)
159 void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
162 #if defined(ENABLE_INTRP)
163 void intrp_asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
167 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
168 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
169 u1* asm_initialize_thread_stack(void *func, u1 *stack);
172 /* cache flush function */
173 void asm_cacheflush(u1 *addr, s4 nbytes);
175 u8 asm_get_cycle_count(void);
177 #endif /* _ASMPART_H */
181 * These are local overrides for various environment variables in Emacs.
182 * Please do not remove this and leave it at the end of the file, where
183 * Emacs will automagically detect them.
184 * ---------------------------------------------------------------------
187 * indent-tabs-mode: t
191 * vim:noexpandtab:sw=4:ts=4: