* Removed all Id tags.
[cacao.git] / src / vm / jit / intrp / intrp.h
index dd1d0d48ba41ec8d0965fe5b7884a3760e4895eb..c4e988201eab15b97ef0c81c2fc49db147684526 100644 (file)
@@ -1,9 +1,9 @@
 /* src/vm/jit/intrp/intrp.h - definitions for Interpreter
 
-   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
+   Copyright (C) 1996-2005, 2006, 2007 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.
 
 
    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.
-
-   Contact: cacao@complang.tuwien.ac.at
-
-   Authors: Christian Thalinger
-            Anton Ertl
-
-   Changes:
-
-   $Id: intrp.h 3902 2005-12-07 17:32:57Z anton $
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
 */
 
 #ifndef _INTRP_H
 #define _INTRP_H
 
-#include <stdio.h>
-
 /* #define VM_PROFILING */
 
 #include "config.h"
-#include "vm/types.h"
 
-#include "arch.h"
-
-#include "vm/class.h"
-#include "vm/global.h"
-#include "vm/method.h"
-#include "vm/references.h"
-#include "vm/resolve.h"
+#include <stdio.h>
 
-#include "libffi/include/ffi.h"
+#include "vm/types.h"
 
+#include "arch.h"
 
-typedef void *Label;
-typedef void *Inst;
+/* we need Cell in some headers below */
 
 #if SIZEOF_VOID_P == 8
 typedef s8 Cell;
@@ -64,6 +46,20 @@ typedef s8 Cell;
 typedef s4 Cell;
 #endif
 
+#include "vm/global.h"
+
+#include "vm/jit/codegen-common.h"
+
+#include "vmcore/class.h"
+#include "vmcore/method.h"
+#include "vmcore/references.h"
+#include "vm/resolve.h"
+#include "vmcore/linker.h"
+
+
+typedef void *Label;
+typedef void *Inst;
+
 #if 1
 #define MAYBE_UNUSED __attribute__((unused))
 #else
@@ -110,11 +106,11 @@ typedef union {
 #endif /* SIZEOF_VOID_P == 4 */
 
 
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+#if defined(ENABLE_THREADS)
 
-#define global_sp    (*(Cell **)&(THREADINFO->_global_sp))
+#define global_sp    (THREADOBJECT->_global_sp)
 
-#else /* defined(USE_THREADS) && defined(NATIVE_THREADS) */
+#else /* defined(ENABLE_THREADS) */
 
 #define MAX_STACK_SIZE 128*1024
 static char stack[MAX_STACK_SIZE];
@@ -122,7 +118,7 @@ static char stack[MAX_STACK_SIZE];
 static Cell *_global_sp = (Cell *)(stack+MAX_STACK_SIZE);
 #define global_sp    _global_sp
 
-#endif /* defined(USE_THREADS) && defined(NATIVE_THREADS) */
+#endif /* defined(ENABLE_THREADS) */
 
 #define CLEAR_global_sp (global_sp=NULL)
 
@@ -144,6 +140,7 @@ static Cell *_global_sp = (Cell *)(stack+MAX_STACK_SIZE);
 #define vm_Cell2acr(x1,x2)        ((x2) = (constant_classref *)(x1))
 #define vm_Cell2addr(x1,x2)       ((x2) = (u1 *               )(x1))
 #define vm_Cell2af(x1,x2)         ((x2) = (functionptr        )(x1))
+#define vm_Cell2afi(x1,x2)        ((x2) = (fieldinfo *        )(x1))
 #define vm_Cell2am(x1,x2)         ((x2) = (methodinfo *       )(x1))
 #define vm_Cell2acell(x1,x2)      ((x2) = (Cell *             )(x1))
 #define vm_Cell2ainst(x1,x2)      ((x2) = (Inst *             )(x1))
@@ -163,6 +160,7 @@ static Cell *_global_sp = (Cell *)(stack+MAX_STACK_SIZE);
 #define vm_acr2Cell(x1,x2) ((x2) = (Cell)(x1))
 #define vm_addr2Cell(x1,x2) ((x2) = (Cell)(x1))
 #define vm_af2Cell(x1,x2) ((x2) = (Cell)(x1))
+#define vm_afi2Cell(x1,x2) ((x2) = (Cell)(x1))
 #define vm_am2Cell(x1,x2) ((x2) = (Cell)(x1))
 #define vm_acell2Cell(x1,x2) ((x2) = (Cell)(x1))
 #define vm_ainst2Cell(x1,x2) ((x2) = (Cell)(x1))
@@ -179,6 +177,7 @@ static Cell *_global_sp = (Cell *)(stack+MAX_STACK_SIZE);
 
 
 #define gen_BBSTART (cd->lastmcodeptr = NULL, append_dispatch(cd))
+#define gen_BBEND (finish_ss(cd))
 
 
 union Cell_float {
@@ -204,19 +203,19 @@ typedef struct block_count block_count;
 
 extern Inst *vm_prim;
 extern Cell peeptable;
-extern Inst *last_compiled;
 extern FILE *vm_out;
 
+/* defined in peephole.c: */
 void init_peeptable(void);
-Inst peephole_opt(Inst inst1, Inst inst2, Cell peeptable);
-void gen_inst(codegendata *cd, u4 instr);
+ptrint peephole_opt(ptrint inst1, ptrint inst2, Cell peeptable);
+
+/* defined in engine.c: */
+java_objectheader *engine(Inst *ip0, Cell * sp, Cell * fp);
 
+/* defined in disass.c: */
 void vm_disassemble(Inst *ip, Inst *endp, Inst vm_prim[]);
 Inst *vm_disassemble_inst(Inst *ip, Inst vm_prim[]);
 
-java_objectheader *engine(Inst *ip0, Cell * sp, Cell * fp);
-ffi_type *cacaotype2ffitype(s4 cacaotype);
-
 /* print types for disassembler and tracer */
 void printarg_ui      (u4                 ui      );
 void printarg_v       (Cell               v       );
@@ -233,6 +232,7 @@ void printarg_aClass  (classinfo *        aClass  );
 void printarg_acr     (constant_classref *acr     );
 void printarg_addr    (u1 *               addr    );
 void printarg_af      (functionptr        af      );
+void printarg_afi     (fieldinfo *        afi     );
 void printarg_am      (methodinfo *       am      );
 void printarg_acell   (Cell *             acell   );
 void printarg_ainst   (Inst *             ainst   );
@@ -241,13 +241,24 @@ void printarg_aum     (unresolved_method *aum     );
 void printarg_avftbl  (vftbl_t *          avftbl  );
 void printarg_Cell    (Cell               x       );
 
+/* defined in profile.c: */
 void vm_uncount_block(Inst *ip);
 block_count *vm_block_insert(Inst *ip);
 
+/* defined in codegen.c: */
 Cell *nativecall(functionptr f, methodinfo *m, Cell *sp, Inst *ra, Cell *fp, u1 *addrcif);
 u1 *createcalljavafunction(methodinfo *m);
 
-Inst *asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell **new_spp, Cell **new_fpp);
+/* defined in asmpart.c: */
+Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell **new_spp, Cell **new_fpp);
+
+/* defined in dynamic-super.c: */
+void gen_inst(codegendata *cd, ptrint instr);
+void append_dispatch(codegendata *cd);
+void finish_ss(codegendata *cd);
+void patchersuper_rewrite(Inst *p);
+void dynamic_super_init(void);
+void dynamic_super_rewrite(codegendata *cd);
 
 #endif /* _INTRP_H */
 
@@ -263,4 +274,5 @@ Inst *asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell **new_
  * c-basic-offset: 4
  * tab-width: 4
  * End:
+ * vim:noexpandtab:sw=4:ts=4:
  */