/* src/vm/jit/parse.h - parser header
- Copyright (C) 1996-2005, 2006 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, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Contact: cacao@cacaojvm.org
-
- Author: Christian Thalinger
- Edwin Steiner
-
- $Id: parse.h 7628 2007-04-02 19:09:52Z michi $
-
*/
#include "vm/types.h"
#include "vm/global.h"
-#include "vm/jit/codegen-common.h"
+#include "vm/jit/codegen-common.hpp"
/* macros for verifier checks during parsing **********************************/
/* basic block generating macro ***********************************************/
-#define MARK_BASICBLOCK(i) \
+#define MARK_BASICBLOCK(pd, i) \
do { \
- if (!(jd->basicblockindex[(i)] & 1)) { \
- b_count++; \
- jd->basicblockindex[(i)] |= 1; \
- } \
+ (pd)->basicblockstart[(i)] = 1; \
} while (0)
#define INSTRUCTIONS_CHECK(i) \
- if ((icount + (i)) > pd.instructionslength) \
- iptr = parse_realloc_instructions(&pd, icount, (i))
+ if ((ircount + (i)) > pd.instructionslength) \
+ iptr = parse_realloc_instructions(&pd, ircount, (i))
/* intermediate code generating macros ****************************************/
/* afterwards. */
#define PINC \
- iptr++; icount++
+ iptr++; ircount++
#define OP_PREPARE_FLAGS(o, f) \
- iptr->opc = (o); \
- iptr->line = currentline; \
- iptr->flags.bits = (f) | (icount << INS_FLAG_ID_SHIFT);
+ iptr->opc = (o); \
+ iptr->line = currentline; \
+ iptr->flags.bits |= (f) | (ircount << INS_FLAG_ID_SHIFT);
#define OP_PREPARE_ZEROFLAGS(o) \
OP_PREPARE_FLAGS(o, 0)
} while (0)
#define OP_BUILTIN_CHECK_EXCEPTION(bte) \
- jd->isleafmethod = false; \
+ code_unflag_leafmethod(code); \
OP_PREPARE_FLAGS(ICMD_BUILTIN, INS_FLAG_CHECK); \
iptr->sx.s23.s3.bte = (bte); \
PINC
#define OP_BUILTIN_NO_EXCEPTION(bte) \
- jd->isleafmethod = false; \
+ code_unflag_leafmethod(code); \
OP_PREPARE_ZEROFLAGS(ICMD_BUILTIN); \
iptr->sx.s23.s3.bte = (bte); \
PINC
#define OP_BUILTIN_ARITHMETIC(opcode, bte) \
- jd->isleafmethod = false; \
+ code_unflag_leafmethod(code); \
OP_PREPARE_FLAGS(opcode, INS_FLAG_CHECK); \
iptr->sx.s23.s3.bte = (bte); \
PINC
iptr->sx.s23.s3.fmiref = (fmiref);
-/* external macros ************************************************************/
-
-#define BLOCK_OF(index) \
- (jd->basicblocks + jd->basicblockindex[index])
-
-
/* function prototypes ********************************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
bool parse(jitdata *jd);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _PARSE_H */