Changes: Christian Thalinger
Edwin Steiner
- $Id: jit.h 5210 2006-08-07 11:10:01Z twisti $
+ $Id: jit.h 5262 2006-08-22 19:53:56Z twisti $
*/
#if defined(ENABLE_LOOP)
# include "vm/jit/loop/loop.h"
#endif
+#if defined(ENABLE_SSA)
+# include "vm/jit/optimizing/lsra.h"
+#endif
+#if defined(ENABLE_LSRA)
+# include "vm/jit/allocator/lsra.h"
+#endif
#include "vm/jit/verify/typeinfo.h"
-
/* common jit/codegen macros **************************************************/
#if defined(ENABLE_STATISTICS)
#if defined(ENABLE_LOOP)
loopdata *ld;
#endif
+#if defined(ENABLE_SSA) || defined(ENABLE_LSRA)
+ lsradata *ls;
+#endif
u4 flags; /* contains JIT compiler flags */
bool isleafmethod; /* does method call subroutines */
+ s4 stackframesize; /* size of the current stackframe */
new_instruction *new_instructions;
basicblock *new_basicblocks;
#define INSTRUCTION_IS_UNRESOLVED(iptr) \
((ptrint)(iptr)->target & 0x01) /* XXX target used temporarily as flag */
+#define NEW_INSTRUCTION_IS_RESOLVED(iptr) \
+ (!((iptr)->flags.bits & INS_FLAG_UNRESOLVED))
+
+#define NEW_INSTRUCTION_IS_UNRESOLVED(iptr) \
+ ((iptr)->flags.bits & INS_FLAG_UNRESOLVED)
+
+#define NEW_INSTRUCTION_MUST_CHECK(iptr) \
+ (!((iptr)->flags.bits & INS_FLAG_NOCHECK))
+
#define NEW_INSTRUCTION_GET_FIELDREF(iptr,fref) \
do { \
if (iptr->flags.bits & INS_FLAG_UNRESOLVED) \
/* the others by using bitfields. */
struct basicblock {
- s4 debug_nr; /* basic block number */
+ s4 nr; /* basic block number */
s4 flags; /* used during stack analysis, init with -1 */
s4 bitflags; /* OR of BBFLAG_... constants, init with 0 */
s4 type; /* basic block type (std, xhandler, subroutine*/
/* Macro for initializing newly allocated basic block's. It does not
need to zero fields, as we zero out the whole basic block array. */
-#define BASICBLOCK_INIT(bptr,m) \
- do { \
- bptr->mpc = -1; \
- bptr->flags = -1; \
- bptr->type = BBTYPE_STD; \
- bptr->method = (m); \
- bptr->debug_nr = (m)->c_debug_nr++; \
+#define BASICBLOCK_INIT(bptr,m) \
+ do { \
+ bptr->mpc = -1; \
+ bptr->flags = -1; \
+ bptr->type = BBTYPE_STD; \
+ bptr->method = (m); \
+ bptr->nr = (m)->c_debug_nr++; \
} while (0)
/***************************** register info block ****************************/
extern int stackreq[256];
-
+/* extern int op_needs_saved[256]; */
+/* extern int op_is_pei[256]; */
+#define NEEDS_SAVED 0
+#define PEI 1
+#define OP_DATA_SIZE 2
+extern int op_data[256][OP_DATA_SIZE];
+/* [0..255][NEEDS_SAVED] ... if ICMD needs a SAVEDVAR */
+/* [0..255][PEI] ... if ICMD could throw an exception */
/* function prototypes ********************************************************/