src/vm/cycles-stats.h: Switched from asm_get_cycle_count to md_get_cycle_count.
[cacao.git] / src / vm / jit / asmpart.h
index 5788cda17297efe355e5c98b8abcb2bce1bda85f..8769403d7392d8aae2776f220cd5489846f349d7 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/asmpart.h - prototypes for machine specfic functions
 
-   Copyright (C) 1996-2005, 2006 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
+   Copyright (C) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Reinhard Grafl
-            Andreas Krall
-
-   Changes: Christian Thalinger
-            Edwin Steiner
-
-   $Id: asmpart.h 4707 2006-03-30 09:52:49Z twisti $
-
 */
 
 
 #define _ASMPART_H
 
 #include "config.h"
-#include "vm/types.h"
 
+#include <stdint.h>
 
-#if defined(USE_THREADS)
-# if defined(NATIVE_THREADS)
-#  include "threads/native/threads.h"
-# else
-#  include "threads/green/threads.h"
-# endif
-#endif
+#include "vm/types.h"
 
 #include "vm/global.h"
-#include "vm/linker.h"
-#include "vm/resolve.h"
-#include "vm/vm.h"
-#include "vm/jit/replace.h"
-#include "vm/jit/stacktrace.h"
-
-
-/* some macros ****************************************************************/
-
-#if defined(ENABLE_JIT)
-# if defined(ENABLE_INTRP)
-
-#  define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
-    do { \
-        if (opt_intrp) \
-            intrp_asm_getclassvalues_atomic((super), (sub), (out)); \
-        else \
-            asm_getclassvalues_atomic((super), (sub), (out)); \
-    } while (0)
-
-# else /* defined(ENABLE_INTRP) */
-
-#  define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
-    asm_getclassvalues_atomic((super), (sub), (out))
-
-# endif /* defined(ENABLE_INTRP) */
-
-#else /* defined(ENABLE_JIT) */
-
-#  define ASM_GETCLASSVALUES_ATOMIC(super,sub,out) \
-    intrp_asm_getclassvalues_atomic((super), (sub), (out))
-
-#endif /* defined(ENABLE_JIT) */
-
-
-typedef struct castinfo castinfo;
-
-struct castinfo {
-       s4 super_baseval;
-       s4 super_diffval;
-       s4 sub_baseval;
-};
+#include "vm/vm.hpp"
 
 
 /* function prototypes ********************************************************/
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* 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);
-
+#endif
 
 #if defined(ENABLE_JIT)
-java_objectheader *asm_vm_call_method(methodinfo *m, s4 vmargscount,
-                                                                         vm_arg *vmargs);
+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);
 
-s4     asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
-s8     asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
-float  asm_vm_call_method_float(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
-double asm_vm_call_method_double(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+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);
 
 void   asm_vm_call_method_exception_handler(void);
+void   asm_vm_call_method_end(void);
 #endif
 
 #if defined(ENABLE_INTRP)
@@ -134,13 +80,6 @@ double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
                                                                           vm_arg *vmargs);
 #endif
 
-
-/* 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_xhandler2(void);
-#endif
-
 /* exception handling functions */
 
 #if defined(ENABLE_JIT)
@@ -148,36 +87,30 @@ void asm_handle_exception(void);
 void asm_handle_nat_exception(void);
 #endif
 
-/* wrapper for code patching functions */
-void asm_wrapper_patcher(void);
-
-/* functions for on-stack replacement */
-void asm_replacement_out(void);
-void asm_replacement_in(executionstate *es);
-
-void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
-
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
-extern threadcritnode asm_criticalsections;
-#endif
-
-
+/* stub for throwing AbstractMethodError's */
 #if defined(ENABLE_JIT)
-void asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
+void asm_abstractmethoderror(void);
 #endif
 
 #if defined(ENABLE_INTRP)
-void intrp_asm_getclassvalues_atomic(vftbl_t *super, vftbl_t *sub, castinfo *out);
+void intrp_asm_abstractmethoderror(void);
 #endif
 
+/* wrapper for code patching functions */
+void asm_patcher_wrapper(void);
+
+/* cache flush function */
+void asm_cacheflush(void* addr, int nbytes);
+
+void *md_asm_codegen_get_pv_from_pc(void *ra);
 
-#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);
+#if defined(ENABLE_ESCAPE_CHECK)
+void asm_escape_check(java_object_t *obj);
 #endif
 
-/* cache flush function */
-void asm_cacheflush(u1 *addr, s4 nbytes);
+#ifdef __cplusplus
+} // extern "C"
+#endif
 
 #endif /* _ASMPART_H */