X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fjit%2Fasmpart.h;h=ecb44b785fd2b965f31466e0e213fffaca2af1b3;hb=7006e0bf26bd3bb0562388b873bc66fdfd9905ec;hp=a8ff334c987701e0a1196daccb599792f5cde9b3;hpb=2c6545cefe86723a99d9d1b8bb0fe48c7b01e0f7;p=cacao.git diff --git a/src/vm/jit/asmpart.h b/src/vm/jit/asmpart.h index a8ff334c9..ecb44b785 100644 --- a/src/vm/jit/asmpart.h +++ b/src/vm/jit/asmpart.h @@ -1,9 +1,7 @@ -/* asmpart.h - prototypes for machine specfic functions +/* src/vm/jit/asmpart.h - prototypes for machine specfic functions - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 - R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, - M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck, - P. Tomsich, J. Wenninger + Copyright (C) 1996-2005, 2006, 2007, 2008 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This file is part of CACAO. @@ -19,88 +17,102 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. - Contact: cacao@complang.tuwien.ac.at +*/ - Authors: Reinhard Grafl - Andreas Krall - Changes: Christian Thalinger +#ifndef _ASMPART_H +#define _ASMPART_H - $Id: asmpart.h 1112 2004-05-31 15:47:20Z jowenn $ +#include "config.h" -*/ +#include +#ifdef __cplusplus +extern "C" { +#endif -#ifndef _ASMPART_H -#define _ASMPART_H +#include "vm/types.h" -#include "global.h" -#include "jni.h" -#include "threads/thread.h" +#include "vm/global.h" +#include "vm/vm.hpp" -/* - determines if the byte support instruction set (21164a and higher) - is available. -*/ -int has_no_x_instr_set(); -void synchronize_caches(); +/* function prototypes ********************************************************/ +/* machine dependent initialization */ +s4 asm_md_init(void); +#if !defined(JIT_COMPILER_VIA_SIGNAL) /* invokes the compiler for untranslated JavaVM methods. Register R0 contains a pointer to the method info structure (prepared by createcompilerstub). */ -void asm_call_jit_compiler(); +void asm_call_jit_compiler(void); +#endif +#if defined(ENABLE_JIT) +java_object_t *asm_vm_call_method(void *pv, uint64_t *array, int32_t stackargs); +int32_t asm_vm_call_method_int(void *pv, uint64_t *array, int32_t stackargs); -/* - This function calls a Java-method (which possibly needs compilation) - with up to 4 parameters. This function calls a Java-method (which - possibly needs compilation) with up to 4 parameters. -*/ +int64_t asm_vm_call_method_long(void *pv, uint64_t *array, int32_t stackargs); +float asm_vm_call_method_float(void *pv, uint64_t *array, int32_t stackargs); +double asm_vm_call_method_double(void *pv, uint64_t *array, int32_t stackargs); -/* - This function calls a Java-method (which possibly needs compilation) - with up to 4 parameters. This function calls a Java-method (which - possibly needs compilation) with up to 4 parameters. - also supports a return value -*/ -java_objectheader *asm_calljavafunction(methodinfo *m, void *arg1, void *arg2, - void *arg3, void *arg4); -java_objectheader *asm_calljavafunction2(methodinfo *m, u4 count, u4 size, void *callblock); -jdouble asm_calljavafunction2double(methodinfo *m, u4 count, u4 size, void *callblock); -jlong asm_calljavafunction2long(methodinfo *m, u4 count, u4 size, void *callblock); +void asm_vm_call_method_exception_handler(void); +void asm_vm_call_method_end(void); +#endif + +#if defined(ENABLE_INTRP) +java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount, + vm_arg *vmargs); + +s4 intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount, + vm_arg *vmargs); +s8 intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount, + vm_arg *vmargs); +float intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount, + vm_arg *vmargs); +double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount, + vm_arg *vmargs); +#endif +/* exception handling functions */ +#if defined(ENABLE_JIT) +void asm_handle_exception(void); +void asm_handle_nat_exception(void); +#endif -void asm_handle_exception(); -void asm_handle_nat_exception(); +/* stub for throwing AbstractMethodError's */ +#if defined(ENABLE_JIT) +void asm_abstractmethoderror(void); +#endif -void asm_check_clinit(); +#if defined(ENABLE_INTRP) +void intrp_asm_abstractmethoderror(void); +#endif -void asm_handle_builtin_exception(classinfo *); -void asm_throw_and_handle_exception(); -void asm_throw_and_handle_hardware_arithmetic_exception(); +/* wrapper for code patching functions */ +void asm_patcher_wrapper(void); -java_objectarray* Java_java_lang_VMSecurityManager_getClassContext(JNIEnv *env, jclass clazz); -stacktraceelement *asm_get_stackTrace(); +/* cache flush function */ +void asm_cacheflush(void* addr, int nbytes); -/*java_lang_ClassLoader* Java_java_lang_VMSecurityManager_currentClassLoader(JNIEnv *env, jclass clazz);*/ +u8 asm_get_cycle_count(void); -void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p); +void *md_asm_codegen_get_pv_from_pc(void *ra); -void asm_builtin_trace(); -void asm_builtin_exittrace(); +#if defined(ENABLE_ESCAPE_CHECK) +void asm_escape_check(java_object_t *obj); +#endif -#if defined(USE_THREADS) && defined(NATIVE_THREADS) -extern threadcritnode *asm_criticalsections; +#ifdef __cplusplus +} #endif -void asm_getclassvalues_atomic(vftbl *super, vftbl *sub, castinfo *out); #endif /* _ASMPART_H */ @@ -116,4 +128,5 @@ void asm_getclassvalues_atomic(vftbl *super, vftbl *sub, castinfo *out); * c-basic-offset: 4 * tab-width: 4 * End: + * vim:noexpandtab:sw=4:ts=4: */