Changes: Christian Thalinger
Edwin Steiner
- $Id: jit.h 5332 2006-09-05 19:38:28Z twisti $
+ $Id: jit.h 5404 2006-09-07 13:29:05Z christian $
*/
#ifndef _JIT_H
#define _JIT_H
+#define NEW_VAR
+
/* forward typedefs ***********************************************************/
typedef struct jitdata jitdata;
s4 new_basicblockcount;
s4 new_stackcount;
s4 new_c_debug_nr;
+
+#if defined(NEW_VAR)
+ varinfo *var;
+ s4 vartop;
+
+ s4 varcount;
+ s4 localcount;
+ s4 *local_map; /* internal structure to rename(de-coallesc) locals */
+ /* and keep the coalescing info for simplereg. */
+ /* local_map[local_index * 5 + local_type] = */
+ /* new_index in rd->var or LOCAL_UNUSED */
+ s4 *interface_map; /* like local_map for interfaces */
+#endif
};
+#define UNUSED -1
#define JITDATA_FLAG_PARSE 0x00000001
#define JITDATA_FLAG_VERIFY 0x00000002
((jd)->flags & JITDATA_FLAG_VERBOSECALL)
-/************************** stack element structure ***************************/
+/* stack element structure ****************************************************/
/* flags */
/* using the same register/memory location */
#define STKEEP 32 /* to prevent reg_mark_copy to free this */
/* stackslot */
+#define PREALLOC 64 /* preallocated var like for ARGVARS. Used */
+ /* with the new var system */
+#define OUTVAR 128 /* STACKVR flag for new var system */
+
+#define IS_SAVEDVAR(x) ((x) & SAVEDVAR)
+#define IS_INMEMORY(x) ((x) & INMEMORY)
+
/* variable kinds */
/*** s1 operand ***/
typedef union {
+#if defined(NEW_VAR)
+ s4 varindex;
+#else
stackptr var;
s4 localindex;
+#endif
s4 argcount;
} s1_operand_t;
/*** s2 operand ***/
typedef union {
+#if defined(NEW_VAR)
+ s4 varindex;
+ s4 *args;
+#else
stackptr var;
stackptr *args;
+#endif
classref_or_classinfo c;
unresolved_class *uc;
ptrint constval; /* for PUT*CONST */
/*** s3 operand ***/
typedef union {
+#if defined(NEW_VAR)
+ s4 varindex;
+#else
stackptr var;
+#endif
ptrint constval;
classref_or_classinfo c;
constant_FMIref *fmiref;
/*** dst operand ***/
typedef union {
+#if defined(NEW_VAR)
+ s4 varindex;
+#else
stackptr var;
s4 localindex;
+#endif
basicblock *block; /* valid after stack analysis */
branch_target_t *table; /* for TABLESWITCH */
lookup_target_t *lookup; /* for LOOKUPSWITCH */
s4 insindex; /* used between parse and stack */
+#if defined(NEW_VAR)
+ s4 *dupslots; /* for SWAP, DUP* except DUP */
+#else
stackptr *dupslots; /* for SWAP, DUP* except DUP */
+#endif
} dst_operand_t;
/*** flags (32 bits) ***/
#define INS_FLAG_UNRESOLVED 0x01 /* contains unresolved field/meth/class*/
#define INS_FLAG_CLASS 0x02 /* for ACONST with class */
#define INS_FLAG_ARRAY 0x04 /* for CHECKCAST/INSTANCEOF with array */
-#define INS_FLAG_NOCHECK 0x08
+#define INS_FLAG_CHECK 0x08 /* for *ALOAD|*ASTORE: check index */
+ /* for BUILTIN: check exception */
typedef union {
u4 bits;
((iptr)->flags.bits & INS_FLAG_UNRESOLVED)
#define INSTRUCTION_MUST_CHECK(iptr) \
- (!((iptr)->flags.bits & INS_FLAG_NOCHECK))
+ ((iptr)->flags.bits & INS_FLAG_CHECK)
#define INSTRUCTION_GET_FIELDREF(iptr,fref) \
do { \
s4 icount; /* number of intermediate code instructions */
s4 mpc; /* machine code pc at start of block */
stackptr instack; /* stack at begin of basic block */
- stackptr *invars; /* array of in-variables at begin of block */
stackptr outstack; /* stack at end of basic block */
+#if defined(NEW_VAR)
+ s4 *invars; /* array of in-variables at begin of block */
+ s4 *outvars; /* array of out-variables at end of block */
+#else
+ stackptr *invars; /* array of in-variables at begin of block */
stackptr *outvars; /* array of out-variables at end of block */
+#endif
s4 indepth; /* stack depth at begin of basic block */
s4 outdepth; /* stack depth end of basic block */