1 /* src/vm/jit/asmpart.h - prototypes for machine specfic functions
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 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., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Reinhard Grafl
30 Changes: Christian Thalinger
32 $Id: asmpart.h 3001 2005-07-12 16:01:56Z twisti $
40 #if defined(USE_THREADS)
41 # if defined(NATIVE_THREADS)
42 # include "threads/native/threads.h"
44 # include "threads/green/threads.h"
48 #include "vm/resolve.h"
49 #include "vm/jit/stacktrace.h"
52 typedef struct castinfo castinfo;
61 #if defined(__ALPHA__)
63 determines if the byte support instruction set (21164a and higher)
66 int has_no_x_instr_set(void);
67 void asm_sync_instruction_cache(void);
72 invokes the compiler for untranslated JavaVM methods.
73 Register R0 contains a pointer to the method info structure
74 (prepared by createcompilerstub).
76 void asm_call_jit_compiler(void);
80 This function calls a Java-method (which possibly needs compilation)
81 with up to 4 parameters. This function calls a Java-method (which
82 possibly needs compilation) with up to 4 parameters.
84 java_objectheader *asm_calljavafunction(methodinfo *m, void *arg1, void *arg2,
85 void *arg3, void *arg4);
87 s4 asm_calljavafunction_int(methodinfo *m, void *arg1, void *arg2,
88 void *arg3, void *arg4);
92 This function calls a Java-method (which possibly needs compilation)
93 with up to 4 parameters. This function calls a Java-method (which
94 possibly needs compilation) with up to 4 parameters.
95 also supports a return value
97 java_objectheader *asm_calljavafunction2(methodinfo *m, u4 count, u4 size, void *callblock);
98 s4 asm_calljavafunction2int(methodinfo *m, u4 count, u4 size, void *callblock);
99 s8 asm_calljavafunction2long(methodinfo *m, u4 count, u4 size, void *callblock);
100 float asm_calljavafunction2float(methodinfo *m, u4 count, u4 size, void *callblock);
101 double asm_calljavafunction2double(methodinfo *m, u4 count, u4 size, void *callblock);
103 /* We need these two labels in codegen.inc to add the asm_calljavafunction*'s
104 into the methodtable */
105 #if defined(__I386__) || defined(__X86_64__)
106 void calljava_xhandler(void);
107 void calljava_xhandler2(void);
110 /* exception handling functions */
111 void asm_handle_exception(void);
112 void asm_handle_nat_exception(void);
114 /* wrapper for code patching functions */
115 void asm_wrapper_patcher(void);
117 void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
119 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
120 extern threadcritnode asm_criticalsections;
123 void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
125 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
126 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
127 u1* asm_initialize_thread_stack(void *func, u1 *stack);
130 #endif /* _ASMPART_H */
134 * These are local overrides for various environment variables in Emacs.
135 * Please do not remove this and leave it at the end of the file, where
136 * Emacs will automagically detect them.
137 * ---------------------------------------------------------------------
140 * indent-tabs-mode: t