CACAO
Data Structures | Macros | Typedefs | Functions
parse.cpp File Reference

Go to the source code of this file.

Data Structures

struct  parsedata_t
 

Macros

#define INDEX_ONEWORD(num)
 
#define INDEX_TWOWORD(num)
 
#define CHECK_BYTECODE_INDEX(i)
 
#define CHECK_BYTECODE_INDEX_EXCLUSIVE(i)
 
#define MARK_BASICBLOCK(pd, i)
 
#define INSTRUCTIONS_CHECK(i)
 
#define PINC   iptr++; ircount++
 
#define OP_PREPARE_FLAGS(o, f)
 
#define OP_PREPARE_ZEROFLAGS(o)   OP_PREPARE_FLAGS(o, 0)
 
#define OP_PREPARE(o)   OP_PREPARE_ZEROFLAGS(o)
 
#define OP(o)
 
#define OP_CHECK_EXCEPTION(o)
 
#define OP_LOADCONST_I(v)
 
#define OP_LOADCONST_L(v)
 
#define OP_LOADCONST_F(v)
 
#define OP_LOADCONST_D(v)
 
#define OP_LOADCONST_NULL()
 
#define OP_LOADCONST_STRING(v)
 
#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS(cl, cr, extraflags)
 
#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)
 
#define OP_INSINDEX(o, iindex)
 
#define OP_LOCALINDEX(o, index)
 
#define OP_LOCALINDEX_I(o, index, v)
 
#define LOCALTYPE_USED(index, type)
 
#define OP_LOAD_ONEWORD(o, index, type)
 
#define OP_LOAD_TWOWORD(o, index, type)
 
#define OP_STORE_ONEWORD(o, index, type)
 
#define OP_STORE_TWOWORD(o, index, type)
 
#define OP_BUILTIN_CHECK_EXCEPTION(BTE)
 
#define OP_BUILTIN_NO_EXCEPTION(BTE)
 
#define OP_BUILTIN_ARITHMETIC(opcode, BTE)
 
#define OP_FMIREF_PREPARE(o, FMIREF)
 
#define INSTRUCTIONS_INCREMENT   5 /* number of additional instructions to */
 
#define BYTECODEINDEX_TO_BASICBLOCK(dst)
 
#define CHECK_END_OF_BYTECODE(neededlength)
 

Typedefs

typedef struct parsedata_t parsedata_t
 

Functions

static void parse_setup (jitdata *jd, parsedata_t *pd)
 
static instructionparse_realloc_instructions (parsedata_t *pd, s4 icount, s4 n)
 
static basicblockparse_bytecodeindex_to_basicblock (jitdata *jd, parsedata_t *pd, s4 bcindex)
 
static bool parse_mark_exception_boundaries (jitdata *jd, parsedata_t *pd)
 
static bool parse_resolve_exception_table (jitdata *jd, parsedata_t *pd)
 
bool parse (jitdata *jd)
 

Macro Definition Documentation

#define BYTECODEINDEX_TO_BASICBLOCK (   dst)
Value:
do { \
(dst).block = \
parse_bytecodeindex_to_basicblock(jd, &pd, (dst).insindex); \
} while (0)
static basicblock * parse_bytecodeindex_to_basicblock(jitdata *jd, parsedata_t *pd, s4 bcindex)
Definition: parse.cpp:410
BeginInst *& block

Definition at line 306 of file parse.cpp.

#define CHECK_BYTECODE_INDEX (   i)
Value:
do { \
if (((i) < 0) || ((i) >= m->jcodelength)) \
goto throw_invalid_bytecode_index; \
} while (0)
MIIterator i

Definition at line 88 of file parse.cpp.

#define CHECK_BYTECODE_INDEX_EXCLUSIVE (   i)
Value:
do { \
if ((i) < 0 || (i) > m->jcodelength) \
goto throw_invalid_bytecode_index; \
} while (0)
MIIterator i

Definition at line 96 of file parse.cpp.

#define CHECK_END_OF_BYTECODE (   neededlength)
Value:
do { \
if ((neededlength) > m->jcodelength) \
goto throw_unexpected_end_of_bytecode; \
} while (0)

Definition at line 595 of file parse.cpp.

#define INDEX_ONEWORD (   num)
Value:
do { \
if (((num) < 0) || ((num) >= m->maxlocals)) \
goto throw_illegal_local_variable_number; \
} while (0)

Definition at line 73 of file parse.cpp.

#define INDEX_TWOWORD (   num)
Value:
do { \
if (((num) < 0) || (((num) + 1) >= m->maxlocals)) \
goto throw_illegal_local_variable_number; \
} while (0)

Definition at line 79 of file parse.cpp.

#define INSTRUCTIONS_CHECK (   i)
Value:
if ((ircount + (i)) > pd.instructionslength) \
iptr = parse_realloc_instructions(&pd, ircount, (i))
static instruction * parse_realloc_instructions(parsedata_t *pd, s4 icount, s4 n)
Definition: parse.cpp:385
MIIterator i

Definition at line 119 of file parse.cpp.

#define INSTRUCTIONS_INCREMENT   5 /* number of additional instructions to */

Definition at line 300 of file parse.cpp.

#define LOCALTYPE_USED (   index,
  type 
)
Value:
do { \
local_map[(index) * 5 + (type)] = 1; \
} while (0)
std::size_t index

Definition at line 239 of file parse.cpp.

#define MARK_BASICBLOCK (   pd,
  i 
)
Value:
do { \
(pd)->basicblockstart[(i)] = 1; \
} while (0)
MIIterator i

Definition at line 114 of file parse.cpp.

#define OP (   o)
Value:
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 154 of file parse.cpp.

#define OP_BUILTIN_ARITHMETIC (   opcode,
  BTE 
)
Value:
iptr->sx.s23.s3.bte = (BTE); \
static void code_unflag_leafmethod(codeinfo *code)
Definition: code.hpp:160
#define OP_PREPARE_FLAGS(o, f)
Definition: parse.cpp:143
#define PINC
Definition: parse.cpp:140

Definition at line 288 of file parse.cpp.

#define OP_BUILTIN_CHECK_EXCEPTION (   BTE)
Value:
iptr->sx.s23.s3.bte = (BTE); \
static void code_unflag_leafmethod(codeinfo *code)
Definition: code.hpp:160
#define OP_PREPARE_FLAGS(o, f)
Definition: parse.cpp:143
#define PINC
Definition: parse.cpp:140

Definition at line 276 of file parse.cpp.

#define OP_BUILTIN_NO_EXCEPTION (   BTE)
Value:
iptr->sx.s23.s3.bte = (BTE); \
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
static void code_unflag_leafmethod(codeinfo *code)
Definition: code.hpp:160
#define PINC
Definition: parse.cpp:140

Definition at line 282 of file parse.cpp.

#define OP_CHECK_EXCEPTION (   o)
Value:
#define OP_PREPARE_FLAGS(o, f)
Definition: parse.cpp:143
#define PINC
Definition: parse.cpp:140

Definition at line 158 of file parse.cpp.

#define OP_FMIREF_PREPARE (   o,
  FMIREF 
)
Value:
iptr->sx.s23.s3.fmiref = (FMIREF);
#define OP_PREPARE(o)
Definition: parse.cpp:151

Definition at line 295 of file parse.cpp.

#define OP_INSINDEX (   o,
  iindex 
)
Value:
iptr->dst.insindex = (iindex); \
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 223 of file parse.cpp.

#define OP_LOAD_ONEWORD (   o,
  index,
  type 
)
Value:
do { \
} while (0)
std::size_t index
#define OP_LOCALINDEX(o, index)
Definition: parse.cpp:228
#define LOCALTYPE_USED(index, type)
Definition: parse.cpp:239
#define INDEX_ONEWORD(num)
Definition: parse.cpp:73

Definition at line 244 of file parse.cpp.

#define OP_LOAD_TWOWORD (   o,
  index,
  type 
)
Value:
do { \
} while (0)
std::size_t index
#define OP_LOCALINDEX(o, index)
Definition: parse.cpp:228
#define LOCALTYPE_USED(index, type)
Definition: parse.cpp:239
#define INDEX_TWOWORD(num)
Definition: parse.cpp:79

Definition at line 251 of file parse.cpp.

#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_CHECK (   c,
  cr 
)    OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS((c), (cr), INS_FLAG_CHECK)

Definition at line 205 of file parse.cpp.

#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS (   cl,
  cr,
  extraflags 
)
Value:
if (cl) { \
iptr->sx.val.c.cls = (cl); \
iptr->flags.bits |= INS_FLAG_CLASS | (extraflags); \
} \
else { \
iptr->sx.val.c.ref = (cr); \
iptr->flags.bits |= INS_FLAG_CLASS | INS_FLAG_UNRESOLVED \
| (extraflags); \
} \
#define PINC
Definition: parse.cpp:140
#define OP_PREPARE(o)
Definition: parse.cpp:151

Definition at line 192 of file parse.cpp.

#define OP_LOADCONST_CLASSINFO_OR_CLASSREF_NOCHECK (   c,
  cr 
)    OP_LOADCONST_CLASSINFO_OR_CLASSREF_FLAGS((c), (cr), 0)

Definition at line 208 of file parse.cpp.

#define OP_LOADCONST_D (   v)
Value:
iptr->sx.val.d = (v); \
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 177 of file parse.cpp.

#define OP_LOADCONST_F (   v)
Value:
iptr->sx.val.f = (v); \
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 172 of file parse.cpp.

#define OP_LOADCONST_I (   v)
Value:
iptr->sx.val.i = (v); \
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 162 of file parse.cpp.

#define OP_LOADCONST_L (   v)
Value:
iptr->sx.val.l = (v); \
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 167 of file parse.cpp.

#define OP_LOADCONST_NULL ( )
Value:
iptr->sx.val.anyptr = NULL; \
#define OP_PREPARE_FLAGS(o, f)
Definition: parse.cpp:143
#define PINC
Definition: parse.cpp:140

Definition at line 182 of file parse.cpp.

#define OP_LOADCONST_STRING (   v)
Value:
iptr->sx.val.stringconst = (v); \
#define OP_PREPARE_FLAGS(o, f)
Definition: parse.cpp:143
#define PINC
Definition: parse.cpp:140

Definition at line 187 of file parse.cpp.

#define OP_LOCALINDEX (   o,
  index 
)
Value:
iptr->s1.varindex = (index); \
std::size_t index
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 228 of file parse.cpp.

#define OP_LOCALINDEX_I (   o,
  index,
 
)
Value:
iptr->s1.varindex = (index); \
iptr->sx.val.i = (v); \
std::size_t index
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define PINC
Definition: parse.cpp:140

Definition at line 233 of file parse.cpp.

#define OP_PREPARE (   o)    OP_PREPARE_ZEROFLAGS(o)

Definition at line 151 of file parse.cpp.

#define OP_PREPARE_FLAGS (   o,
 
)
Value:
iptr->opc = (ICMD) (o); \
iptr->line = currentline; \
iptr->flags.bits |= (f) | (ircount << INS_FLAG_ID_SHIFT);
ICMD
Definition: icmd.hpp:37
#define INS_FLAG_ID_SHIFT

Definition at line 143 of file parse.cpp.

#define OP_PREPARE_ZEROFLAGS (   o)    OP_PREPARE_FLAGS(o, 0)

Definition at line 148 of file parse.cpp.

#define OP_S3_CLASSINFO_OR_CLASSREF (   o,
  c,
  cr,
  extraflags 
)
Value:
if (c) { \
iptr->sx.s23.s3.c.cls= (c); \
iptr->flags.bits |= (extraflags); \
} \
else { \
iptr->sx.s23.s3.c.ref= (cr); \
iptr->flags.bits |= INS_FLAG_UNRESOLVED | (extraflags); \
} \
#define PINC
Definition: parse.cpp:140
#define OP_PREPARE(o)
Definition: parse.cpp:151

Definition at line 211 of file parse.cpp.

#define OP_STORE_ONEWORD (   o,
  index,
  type 
)
Value:
do { \
iptr->dst.varindex = (index); \
} while (0)
std::size_t index
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define LOCALTYPE_USED(index, type)
Definition: parse.cpp:239
#define PINC
Definition: parse.cpp:140
#define INDEX_ONEWORD(num)
Definition: parse.cpp:73

Definition at line 258 of file parse.cpp.

#define OP_STORE_TWOWORD (   o,
  index,
  type 
)
Value:
do { \
iptr->dst.varindex = (index); \
} while (0)
std::size_t index
#define OP_PREPARE_ZEROFLAGS(o)
Definition: parse.cpp:148
#define LOCALTYPE_USED(index, type)
Definition: parse.cpp:239
#define PINC
Definition: parse.cpp:140
#define INDEX_TWOWORD(num)
Definition: parse.cpp:79

Definition at line 267 of file parse.cpp.

#define PINC   iptr++; ircount++

Definition at line 140 of file parse.cpp.

Typedef Documentation

typedef struct parsedata_t parsedata_t

Definition at line 315 of file parse.cpp.

Function Documentation

bool parse ( jitdata jd)

Definition at line 604 of file parse.cpp.

static basicblock* parse_bytecodeindex_to_basicblock ( jitdata jd,
parsedata_t pd,
s4  bcindex 
)
static

Definition at line 410 of file parse.cpp.

static bool parse_mark_exception_boundaries ( jitdata jd,
parsedata_t pd 
)
static

Definition at line 438 of file parse.cpp.

static instruction* parse_realloc_instructions ( parsedata_t pd,
s4  icount,
s4  n 
)
static

Definition at line 385 of file parse.cpp.

static bool parse_resolve_exception_table ( jitdata jd,
parsedata_t pd 
)
static

Definition at line 517 of file parse.cpp.

static void parse_setup ( jitdata jd,
parsedata_t pd 
)
static

Definition at line 335 of file parse.cpp.