* Removed all Id tags.
[cacao.git] / src / vm / jit / intrp / intrp.h
index 657dc0c8c48a3e806e8e67062218902fa46052e2..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 3979 2005-12-21 16:39:52Z anton $
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
 */
 
 #include <stdio.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"
 
-#if defined(WITH_FFI)
-# include <ffi.h>
-#endif
+#include "arch.h"
 
-
-typedef void *Label;
-typedef void *Inst;
+/* we need Cell in some headers below */
 
 #if SIZEOF_VOID_P == 8
 typedef s8 Cell;
@@ -66,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
@@ -112,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];
@@ -124,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)
 
@@ -146,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))
@@ -165,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))
@@ -209,19 +205,16 @@ extern Inst *vm_prim;
 extern Cell peeptable;
 extern FILE *vm_out;
 
+/* defined in peephole.c: */
 void init_peeptable(void);
-s4 peephole_opt(u4 inst1, u4 inst2, Cell peeptable);
-void gen_inst(codegendata *cd, u4 instr);
-
-void vm_disassemble(Inst *ip, Inst *endp, Inst vm_prim[]);
-Inst *vm_disassemble_inst(Inst *ip, Inst vm_prim[]);
+ptrint peephole_opt(ptrint inst1, ptrint inst2, Cell peeptable);
 
+/* defined in engine.c: */
 java_objectheader *engine(Inst *ip0, Cell * sp, Cell * fp);
 
-#if defined(WITH_FFI)
-ffi_type *cacaotype2ffitype(s4 cacaotype);
-#endif
-
+/* defined in disass.c: */
+void vm_disassemble(Inst *ip, Inst *endp, Inst vm_prim[]);
+Inst *vm_disassemble_inst(Inst *ip, Inst vm_prim[]);
 
 /* print types for disassembler and tracer */
 void printarg_ui      (u4                 ui      );
@@ -239,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   );
@@ -247,14 +241,25 @@ 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);
 
+/* 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 */
 
 
@@ -269,4 +274,5 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
  * c-basic-offset: 4
  * tab-width: 4
  * End:
+ * vim:noexpandtab:sw=4:ts=4:
  */