Changes: Edwin Steiner
- $Id: parse.h 5374 2006-09-06 15:22:35Z edwin $
+ $Id: parse.h 5482 2006-09-12 21:34:03Z edwin $
*/
/* basic block generating macro ***********************************************/
-#define MARK_BASICBLOCK(i) \
- do { \
- if (!(jd->new_basicblockindex[(i)] & 1)) { \
- b_count++; \
- jd->new_basicblockindex[(i)] |= 1; \
- } \
+#define MARK_BASICBLOCK(i) \
+ do { \
+ if (!(jd->new_basicblockindex[(i)] & 1)) { \
+ b_count++; \
+ jd->new_basicblockindex[(i)] |= 1; \
+ } \
} while (0)
-#define INSTRUCTIONS_CHECK(i) \
- if ((ipc + (i)) > pd.instructionslength) \
- iptr = parse_check_instructions(&pd, ipc)
+#define INSTRUCTIONS_CHECK(i) \
+ if ((ipc + (i)) > pd.instructionslength) \
+ iptr = parse_realloc_instructions(&pd, ipc, (i))
/* intermediate code generating macros ****************************************/
iptr->opc = (o); \
iptr->line = currentline;
-#define OP_PREPARE_ZEROFLAGS(o) \
+#define OP_PREPARE_FLAGS(o, f) \
iptr->opc = (o); \
iptr->line = currentline; \
- iptr->flags.bits = 0;
+ iptr->flags.bits = (f);
+
+#define OP_PREPARE_ZEROFLAGS(o) \
+ OP_PREPARE_FLAGS(o, 0)
#define OP(o) \
OP_PREPARE_ZEROFLAGS(o); \
PINC
#define OP_LOADCONST_NULL() \
- OP_PREPARE_ZEROFLAGS(ICMD_ACONST); \
+ OP_PREPARE_FLAGS(ICMD_ACONST, INS_FLAG_CHECK); \
iptr->sx.val.anyptr = NULL; \
PINC
#define OP_LOADCONST_STRING(v) \
- OP_PREPARE_ZEROFLAGS(ICMD_ACONST); \
+ OP_PREPARE_FLAGS(ICMD_ACONST, INS_FLAG_CHECK); \
iptr->sx.val.stringconst = (v); \
PINC
-#define OP_LOADCONST_CLASSINFO_OR_CLASSREF(c, cr, extraflags) \
+#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS(cl, cr, extraflags) \
OP_PREPARE(ICMD_ACONST); \
- if (c) { \
- iptr->sx.val.c.cls = (c); \
+ if (cl) { \
+ iptr->sx.val.c.cls = (cl); \
iptr->flags.bits = INS_FLAG_CLASS | (extraflags); \
} \
else { \
} \
PINC
+#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_CHECK(c, cr) \
+ OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS((c), (cr), INS_FLAG_CHECK)
+
+#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_NOCHECK(c, cr) \
+ OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS((c), (cr), 0)
+
#define OP_S3_CLASSINFO_OR_CLASSREF(o, c, cr, extraflags) \
OP_PREPARE(o); \
if (c) { \
iptr->dst.insindex = (iindex); \
PINC
-#if defined(NEW_VAR)
# define OP_LOCALINDEX(o,index) \
OP_PREPARE_ZEROFLAGS(o); \
iptr->s1.varindex = (index); \
# define LOCALTYPE_USED(index,type) \
do { \
- local_map[index * 5 +type] = 1; \
+ local_map[(index) * 5 + (type)] = 1; \
} while (0)
-#else
-# define OP_LOCALINDEX(o,index) \
- OP_PREPARE_ZEROFLAGS(o); \
- iptr->s1.localindex = (index); \
- PINC
-
-# define OP_LOCALINDEX_I(o,index,v) \
- OP_PREPARE_ZEROFLAGS(o); \
- iptr->s1.localindex = (index); \
- iptr->sx.val.i = (v); \
- PINC
-
-# define LOCALTYPE_USED(index,type)
-#endif /* defined(NEW_VAR) */
#define OP_LOAD_ONEWORD(o,index,type) \
do { \
LOCALTYPE_USED(index,type); \
} while (0)
-#if defined(NEW_VAR)
# define OP_STORE_ONEWORD(o,index,type) \
do { \
INDEX_ONEWORD(index); \
LOCALTYPE_USED(index,type); \
PINC; \
} while (0)
-#else
-# define OP_STORE_ONEWORD(o,index,type) \
- do { \
- INDEX_ONEWORD(index); \
- OP_PREPARE_ZEROFLAGS(o); \
- iptr->dst.localindex = (index); \
- LOCALTYPE_USED(index,type); \
- PINC; \
- } while (0)
-
-# define OP_STORE_TWOWORD(o,index,type) \
- do { \
- INDEX_TWOWORD(index); \
- OP_PREPARE_ZEROFLAGS(o); \
- iptr->dst.localindex = (index); \
- LOCALTYPE_USED(index,type); \
- PINC; \
- } while (0)
-#endif /* defined(NEW_VAR) */
#define OP_BUILTIN_CHECK_EXCEPTION(bte) \
jd->isleafmethod = false; \
- OP_PREPARE_ZEROFLAGS(ICMD_BUILTIN); \
+ OP_PREPARE_FLAGS(ICMD_BUILTIN, INS_FLAG_CHECK); \
iptr->sx.s23.s3.bte = (bte); \
PINC
#define OP_BUILTIN_NO_EXCEPTION(bte) \
jd->isleafmethod = false; \
- OP_PREPARE(ICMD_BUILTIN); \
+ OP_PREPARE_ZEROFLAGS(ICMD_BUILTIN); \
iptr->sx.s23.s3.bte = (bte); \
- iptr->flags.bits = INS_FLAG_NOCHECK; \
PINC
#define OP_BUILTIN_ARITHMETIC(opcode, bte) \
jd->isleafmethod = false; \
- OP_PREPARE_ZEROFLAGS(opcode); \
+ OP_PREPARE_FLAGS(opcode, INS_FLAG_CHECK); \
iptr->sx.s23.s3.bte = (bte); \
PINC