57 #define TYPECHECK_NO_STATISTICS
63 #define EXCEPTION do { return false; } while (0)
64 #define VERIFY_ERROR(msg) assert(false)
66 #define CHECK_LOCAL_TYPE(index, t) \
67 assert(jd->var[(index)].type == (t));
69 #define STORE_LOCAL(t, index) \
71 typevector_store(jd->var, (index), (t), NULL); \
74 #define STORE_LOCAL_2_WORD(t, index) \
76 typevector_store(jd->var, (index), (t), NULL); \
79 #define REACH_BLOCK(target) \
81 if (!typestate_reach(state, (target), \
82 state->bptr->outvars, jd->var, \
83 state->bptr->outdepth)) \
87 #define REACH(target) REACH_BLOCK((target).block)
89 #define TYPECHECK_INT(v) assert(jd->var[(v)].type == TYPE_INT)
90 #define TYPECHECK_ADR(v) assert(jd->var[(v)].type == TYPE_ADR)
115 #define TYPECHECK_TYPEINFERER
117 #undef TYPECHECK_TYPEINFERER
145 #define TYPECHECK_TYPEINFERER
146 #define OP1 VAR(state->iptr->sx.s23.s2.args[0])
149 #undef TYPECHECK_TYPEINFERER
177 #define TYPECHECK_TYPEINFERER
178 #define OP1 state->iptr->sx.s23.s2.args[0]
181 #undef TYPECHECK_TYPEINFERER
208 #define TYPECHECK_TYPEINFERER
210 #undef TYPECHECK_TYPEINFERER
244 OLD_LOGSTR1(
"\n---- BLOCK %04d ------------------------------------------------\n",state->
bptr->
nr);
248 superblockend =
false;
293 #define TYPECHECK_TYPEINFERER
295 #define METHOD (state->m)
297 #define BPTR (state->bptr)
298 #include <typecheck-typeinferer-gen.inc>
303 #undef TYPECHECK_TYPEINFERER
306 vm_abort(
"missing ICMD in type inferer: %d\n", opcode);
314 OLD_LOG(
"reaching exception handlers");
330 OLD_LOG(
"\t\tnext instruction");
342 if (!superblockend) {
343 OLD_LOG(
"reaching following block");
372 OLD_LOGSTR(
"\n==============================================================================\n");
374 OLD_LOGSTR(
"\n==============================================================================\n");
433 OLD_LOG(
"Exception handler stacks set.\n");
#define TYPECHECK_COUNT(cnt)
exception_entry ** handlers
static bool handle_invocation(verifier_state *state)
#define TYPECHECK_MARK(var)
exception_entry * exceptiontable
void typecheck_init_state(verifier_state *state, basicblock::State minstate)
bool typecheck_init_locals(verifier_state *state, bool newthis)
static bool handle_basic_block(verifier_state *state)
#define OLD_LOGSTR1(str, a)
void vm_abort(const char *text,...)
void typevector_print(FILE *file, const varinfo *vec, int size)
void show_basicblock(jitdata *jd, basicblock *bptr, int stage)
static bool handle_builtin(verifier_state *state)
#define OLD_LOGIF(cond, str)
void typecheck_reset_state(verifier_state *state)
classref_or_classinfo catchtype
void typevector_copy_inplace(varinfo *src, varinfo *dst, int size)
void show_icmd(jitdata *jd, instruction *iptr, bool deadcode, int stage)
static void * allocate(size_t size)
void jit_check_basicblock_numbers(jitdata *jd)
bool typestate_reach(verifier_state *state, basicblock *destblock, s4 *srcvars, varinfo *srclocals, s4 n)
#define MCOPY(dest, src, type, num)
static bool handle_multianewarray(verifier_state *state)
bool typecheck_infer_types(jitdata *jd)
classinfo * class_java_lang_Throwable
static bool handle_fieldaccess(verifier_state *state, varinfo *instance, varinfo *value)
#define OLD_LOGMETHOD(str, m)