Lazy checkcast and instanceof.
[cacao.git] / src / vm / jit / asmpart.h
index 3f9a2df359415b98e0cf05b00ec5df690496e590..7e24ff6c6973a7c21caf6f330c849e94178a3691 100644 (file)
@@ -1,4 +1,4 @@
-/* vm/jit/asmpart.h - prototypes for machine specfic functions
+/* src/vm/jit/asmpart.h - prototypes for machine specfic functions
 
    Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: asmpart.h 1735 2004-12-07 14:33:27Z twisti $
+   $Id: asmpart.h 2260 2005-04-11 09:46:24Z twisti $
 
 */
 
@@ -37,9 +37,6 @@
 #ifndef _ASMPART_H
 #define _ASMPART_H
 
-#include "native/jni.h"
-#include "vm/global.h"
-
 #if defined(USE_THREADS)
 # if defined(NATIVE_THREADS)
 #  include "threads/native/threads.h"
@@ -48,6 +45,9 @@
 # endif
 #endif
 
+#include "vm/resolve.h"
+#include "vm/jit/stacktrace.h"
+
 
 typedef struct castinfo castinfo;
 
@@ -64,8 +64,6 @@ struct castinfo {
    is available.
 */
 int has_no_x_instr_set();
-
-void synchronize_caches();
 #endif
 
 
@@ -82,6 +80,12 @@ void asm_call_jit_compiler();
    with up to 4 parameters. This function calls a Java-method (which
    possibly needs compilation) with up to 4 parameters.
 */
+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)
@@ -89,11 +93,11 @@ void asm_call_jit_compiler();
    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);
+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 */
@@ -102,11 +106,9 @@ void calljava_xhandler();
 void calljava_xhandler2();
 #endif
 
-
 void asm_handle_exception();
 void asm_handle_nat_exception();
-
-void asm_check_clinit();
+void asm_handle_nullptr_exception();
 
 void asm_handle_builtin_exception(classinfo *);
 void asm_throw_and_handle_exception();
@@ -117,15 +119,28 @@ void asm_throw_and_handle_arrayindexoutofbounds_exception();
 #endif
 void asm_throw_and_handle_hardware_arithmetic_exception();
 
-java_objectarray* Java_java_lang_VMSecurityManager_getClassContext(JNIEnv *env, jclass clazz);
-stacktraceelement *asm_get_stackTrace();
+/* code patching functions */
+void asm_get_putstatic(void);
+void asm_get_putfield(void);
+void asm_builtin_new(unresolved_class *uc);
 
-/*java_lang_ClassLoader* Java_java_lang_VMSecurityManager_currentClassLoader(JNIEnv *env, jclass clazz);*/
+void asm_builtin_newarray(unresolved_class *uc);
+#define asm_BUILTIN_newarray (functionptr) asm_builtin_newarray
 
-void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
+void asm_builtin_multianewarray(unresolved_class *uc);
+#define asm_BUILTIN_multianewarray (functionptr) asm_builtin_multianewarray
+
+void asm_invokestatic_special(void);
+void asm_invokevirtual(void);
+void asm_invokeinterface(void);
+void asm_checkcast_interface(void);
+void asm_checkcast_class(void);
+void asm_check_clinit(void);
 
-void asm_builtin_trace();
-void asm_builtin_exittrace();
+
+stacktraceelement *asm_get_stackTrace();
+
+void *asm_switchstackandcall(void *stack, void *func, void **stacktopsave, void * p);
 
 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
 extern threadcritnode asm_criticalsections;