1 /* 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 2141 2005-03-30 12:51:58Z 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/jit/stacktrace.h"
51 typedef struct castinfo castinfo;
60 #if defined(__ALPHA__)
62 determines if the byte support instruction set (21164a and higher)
65 int has_no_x_instr_set();
70 invokes the compiler for untranslated JavaVM methods.
71 Register R0 contains a pointer to the method info structure
72 (prepared by createcompilerstub).
74 void asm_call_jit_compiler();
78 This function calls a Java-method (which possibly needs compilation)
79 with up to 4 parameters. This function calls a Java-method (which
80 possibly needs compilation) with up to 4 parameters.
82 java_objectheader *asm_calljavafunction(methodinfo *m, void *arg1, void *arg2,
83 void *arg3, void *arg4);
85 s4 asm_calljavafunction_int(methodinfo *m, void *arg1, void *arg2,
86 void *arg3, void *arg4);
90 This function calls a Java-method (which possibly needs compilation)
91 with up to 4 parameters. This function calls a Java-method (which
92 possibly needs compilation) with up to 4 parameters.
93 also supports a return value
95 java_objectheader *asm_calljavafunction2(methodinfo *m, u4 count, u4 size, void *callblock);
96 s4 asm_calljavafunction2int(methodinfo *m, u4 count, u4 size, void *callblock);
97 s8 asm_calljavafunction2long(methodinfo *m, u4 count, u4 size, void *callblock);
98 float asm_calljavafunction2float(methodinfo *m, u4 count, u4 size, void *callblock);
99 double asm_calljavafunction2double(methodinfo *m, u4 count, u4 size, void *callblock);
101 /* We need these two labels in codegen.inc to add the asm_calljavafunction*'s
102 into the methodtable */
103 #if defined(__I386__) || defined(__X86_64__)
104 void calljava_xhandler();
105 void calljava_xhandler2();
109 void asm_handle_exception();
110 void asm_handle_nat_exception();
111 void asm_handle_nullptr_exception();
113 void asm_check_clinit();
115 void asm_handle_builtin_exception(classinfo *);
116 void asm_throw_and_handle_exception();
118 void asm_throw_and_handle_nat_exception();
119 void asm_refillin_and_handle_exception();
120 void asm_throw_and_handle_arrayindexoutofbounds_exception();
122 void asm_throw_and_handle_hardware_arithmetic_exception();
124 java_objectarray* Java_java_lang_VMSecurityManager_getClassContext(JNIEnv *env, jclass clazz);
125 stacktraceelement *asm_get_stackTrace();
127 /*java_lang_ClassLoader* Java_java_lang_VMSecurityManager_currentClassLoader(JNIEnv *env, jclass clazz);*/
129 void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
131 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
132 extern threadcritnode asm_criticalsections;
135 void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
137 void asm_prepare_native_stackinfo(void*ret,void*stackbegin);
138 void asm_remove_native_stackinfo();
140 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
141 void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
142 u1* asm_initialize_thread_stack(void *func, u1 *stack);
145 #endif /* _ASMPART_H */
149 * These are local overrides for various environment variables in Emacs.
150 * Please do not remove this and leave it at the end of the file, where
151 * Emacs will automagically detect them.
152 * ---------------------------------------------------------------------
155 * indent-tabs-mode: t