-/* asmpart.h -
+/* 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 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+ R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+ C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+ Institut f. Computersprachen - TU Wien
This file is part of CACAO.
Authors: Reinhard Grafl
Andreas Krall
- $Id: asmpart.h 557 2003-11-02 22:51:59Z twisti $
+ Changes: Christian Thalinger
+
+ $Id: asmpart.h 2243 2005-04-06 15:49:22Z twisti $
*/
-#include "global.h"
+#ifndef _ASMPART_H
+#define _ASMPART_H
+
+#if defined(USE_THREADS)
+# if defined(NATIVE_THREADS)
+# include "threads/native/threads.h"
+# else
+# include "threads/green/threads.h"
+# endif
+#endif
+
+#include "vm/resolve.h"
+#include "vm/jit/stacktrace.h"
+
+
+typedef struct castinfo castinfo;
+
+struct castinfo {
+ s4 super_baseval;
+ s4 super_diffval;
+ s4 sub_baseval;
+};
+
+#if defined(__ALPHA__)
/*
determines if the byte support instruction set (21164a and higher)
is available.
*/
int has_no_x_instr_set();
-
-void synchronize_caches();
+#endif
/*
with up to 4 parameters. This function calls a Java-method (which
possibly needs compilation) with up to 4 parameters.
*/
-java_objectheader *asm_calljavamethod(methodinfo *m, void *arg1, void *arg2,
- void *arg3, void *arg4);
+java_objectheader *asm_calljavafunction(methodinfo *m, void *arg1, void *arg2,
+ void *arg3, void *arg4);
+
+s4 asm_calljavafunction_int(methodinfo *m, void *arg1, void *arg2,
+ void *arg3, void *arg4);
+
/*
This function calls a Java-method (which possibly needs compilation)
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);
+s4 asm_calljavafunction2int(methodinfo *m, u4 count, u4 size, void *callblock);
+s8 asm_calljavafunction2long(methodinfo *m, u4 count, u4 size, void *callblock);
+float asm_calljavafunction2float(methodinfo *m, u4 count, u4 size, void *callblock);
+double asm_calljavafunction2double(methodinfo *m, u4 count, u4 size, void *callblock);
+
+/* We need these two labels in codegen.inc to add the asm_calljavafunction*'s
+ into the methodtable */
+#if defined(__I386__) || defined(__X86_64__)
+void calljava_xhandler();
+void calljava_xhandler2();
+#endif
+
void asm_handle_exception();
void asm_handle_nat_exception();
+void asm_handle_nullptr_exception();
-/*
- gets the class of the caller from the stack frame
-*/
-methodinfo *asm_getcallingmethod();
+void asm_check_clinit();
+void asm_handle_builtin_exception(classinfo *);
+void asm_throw_and_handle_exception();
+#ifdef __ALPHA__
+void asm_throw_and_handle_nat_exception();
+void asm_refillin_and_handle_exception();
+void asm_throw_and_handle_arrayindexoutofbounds_exception();
+#endif
+void asm_throw_and_handle_hardware_arithmetic_exception();
-/*
- This funtion saves all callee saved registers and calls the function
- which is passed as parameter.
- This function is needed by the garbage collector, which needs to access
- all registers which are stored on the stack. Unused registers are
- cleared to avoid interferances with the GC.
-*/
-void asm_dumpregistersandcall(functionptr f);
-
+stacktraceelement *asm_get_stackTrace();
void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
-void asm_builtin_trace();
-void asm_builtin_exittrace();
+#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+extern threadcritnode asm_criticalsections;
+#endif
+
+void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
+
+void asm_prepare_native_stackinfo(void*ret,void*stackbegin);
+void asm_remove_native_stackinfo();
+
+#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
+void asm_perform_threadswitch(u1 **from, u1 **to, u1 **stackTop);
+u1* asm_initialize_thread_stack(void *func, u1 *stack);
+#endif
+
+/* code patching functions (in asmpart.S) */
+void asm_builtin_new(unresolved_class *uc);
+void asm_invokespecial(void);
+
+/* code patching helper functions (in asmpart.c) */
+classinfo *asm_builtin_new_helper(constant_classref *ref);
+u1 *asm_invokespecial_helper(unresolved_method *um);
+
+#endif /* _ASMPART_H */
/*