Merged revisions 7616-7627 via svnmerge from
[cacao.git] / src / vm / jit / jit.h
index de45e2d222e0dfd9bc6412fc91291e66660c45c5..98d823bbd53371d0d403160a9ab292d6b58ba69a 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/jit/jit.h - code generation header
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   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
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Andreas Krall
-            Reinhard Grafl
-            Christian Thalinger
-            Edwin Steiner
-
-   $Id: jit.h 6211 2006-12-16 22:53:24Z edwin $
+   $Id: jit.h 7627 2007-04-02 18:56:59Z twisti $
 
 */
 
@@ -43,7 +36,6 @@ typedef struct jitdata jitdata;
 typedef struct stackelement stackelement;
 typedef stackelement *stackptr;
 typedef struct basicblock basicblock;
-typedef struct branchref branchref;
 typedef struct instruction instruction;
 typedef struct insinfo_inline insinfo_inline;
 typedef struct exception_entry exception_entry;
@@ -53,14 +45,11 @@ typedef struct exception_entry exception_entry;
 #include "vm/types.h"
 
 #include "toolbox/chain.h"
+
 #include "vm/global.h"
-#include "vm/method.h"
-#include "vm/references.h"
-#include "vm/resolve.h"
-#include "vm/statistics.h"
+
 #include "vm/jit/codegen-common.h"
 #include "vm/jit/reg.h"
-#include "vm/jit/stacktrace.h"
 #include "vm/jit/replace.h"
 
 #if defined(ENABLE_INLINING)
@@ -79,6 +68,15 @@ typedef struct exception_entry exception_entry;
 
 #include "vm/jit/verify/typeinfo.h"
 
+#include "vmcore/method.h"
+#include "vmcore/references.h"
+#include "vm/resolve.h"
+
+#if defined(ENABLE_STATISTICS)
+# include "vmcore/statistics.h"
+#endif
+
+
 /* common jit/codegen macros **************************************************/
 
 #if defined(ENABLE_STATISTICS)
@@ -335,16 +333,17 @@ typedef union {
 
 /*** flags (32 bits) ***/
 
-#define INS_FLAG_UNRESOLVED    0x01    /* contains unresolved field/meth/class*/
-#define INS_FLAG_CLASS         0x02    /* for ACONST, PUT*CONST with class    */
-#define INS_FLAG_ARRAY         0x04    /* for CHECKCAST/INSTANCEOF with array */
-#define INS_FLAG_CHECK         0x08    /* for *ALOAD|*ASTORE: check index     */
+#define INS_FLAG_BASICBLOCK    0x01    /* marks a basic block start           */
+#define INS_FLAG_UNRESOLVED    0x02    /* contains unresolved field/meth/class*/
+#define INS_FLAG_CLASS         0x04    /* for ACONST, PUT*CONST with class    */
+#define INS_FLAG_ARRAY         0x08    /* for CHECKCAST/INSTANCEOF with array */
+#define INS_FLAG_CHECK         0x10    /* for *ALOAD|*ASTORE: check index     */
                                        /* for BUILTIN: check exception        */
-#define INS_FLAG_KILL_PREV     0x02    /* for *STORE, invalidate prev local   */
-#define INS_FLAG_KILL_NEXT     0x04    /* for *STORE, invalidate next local   */
-#define INS_FLAG_RETADDR       0x08    /* for ASTORE: op is a returnAddress   */
+#define INS_FLAG_KILL_PREV     0x04    /* for *STORE, invalidate prev local   */
+#define INS_FLAG_KILL_NEXT     0x08    /* for *STORE, invalidate next local   */
+#define INS_FLAG_RETADDR       0x10    /* for ASTORE: op is a returnAddress   */
 
-#define INS_FLAG_ID_SHIFT      4
+#define INS_FLAG_ID_SHIFT      5
 #define INS_FLAG_ID_MASK       (~0 << INS_FLAG_ID_SHIFT)
 
 typedef union {
@@ -376,6 +375,9 @@ struct instruction {
 };
 
 
+#define INSTRUCTION_STARTS_BASICBLOCK(iptr) \
+       ((iptr)->flags.bits & INS_FLAG_BASICBLOCK)
+
 #define INSTRUCTION_IS_RESOLVED(iptr) \
        (!((iptr)->flags.bits & INS_FLAG_UNRESOLVED))
 
@@ -431,7 +433,9 @@ struct insinfo_inline {
        s4         *javalocals_end;   /* javalocals after inlined body            */
 
        /* fields set by replacement point creation ------------------------------*/
+#if defined(ENABLE_REPLACEMENT)
        rplpoint   *rp;             /* replacement point at INLINE_START          */
+#endif
 
        /* fields set by the codegen ---------------------------------------------*/
        s4          startmpc;       /* machine code offset of start of inlining   */
@@ -513,14 +517,6 @@ struct basicblock {
        } while (0)
                        
 
-/* branchref *****************************************************************/
-
-struct branchref {
-       s4         branchpos;       /* patching position in code segment          */
-       branchref *next;            /* next element in branchref list             */
-};
-
-
 /* data-flow constants for the ICMD table ************************************/
 
 #define DF_0_TO_0      0
@@ -1289,21 +1285,6 @@ void jit_renumber_basicblocks(jitdata *jd);
 void jit_check_basicblock_numbers(jitdata *jd);
 #endif
 
-/* machine dependent functions */
-#if defined(ENABLE_JIT)
-void md_init(void);
-
-u1  *md_get_method_patch_address(u1 *ra, stackframeinfo *sfi, u1 *mptr);
-
-void md_cacheflush(u1 *addr, s4 nbytes);
-void md_icacheflush(u1 *addr, s4 nbytes);
-void md_dcacheflush(u1 *addr, s4 nbytes);
-#endif
-
-#if defined(ENABLE_INTRP)
-void intrp_md_init(void);
-#endif
-
 #endif /* _JIT_H */