CACAO
Macros | Typedefs | Functions
typecheck-stackbased.cpp File Reference

Go to the source code of this file.

Macros

#define CHECK_STACK_DEPTH(d)
 
#define CHECK_STACK_SPACE(d)
 
#define CHECK_STACK_TYPE(s, t)
 
#define CHECK_LOCAL_TYPE(index, t)
 
#define STORE_LOCAL(t, index)
 
#define STORE_LOCAL_2_WORD(t, index)
 
#define VERIFY_ERROR_ret(msg, ret)
 
#define VERIFY_ERROR(msg)   VERIFY_ERROR_ret(msg,false)
 
#define IS_CAT1(slot)   ((slot).type != TYPE_VOID && !IS_2_WORD_TYPE((slot).type))
 
#define IS_CAT2(slot)   ((slot).type != TYPE_VOID && IS_2_WORD_TYPE((slot).type))
 
#define CHECK_CAT1(slot)
 
#define CHECK_CAT2(slot)
 
#define COPY_SLOT(s, d)   do { (d) = (s); } while (0)
 
#define REACH_BLOCK(target)
 
#define REACH(target)
 
#define TYPECHECK_STACKBASED
 
#define EXCEPTION   do { return NULL; } while (0)
 
#define STATE   state
 
#define VERIFY_ERROR(msg)   VERIFY_ERROR_ret(msg,NULL)
 
#define VERIFY_ERROR(msg)   VERIFY_ERROR_ret(msg,false)
 
#define TYPECHECK_STACKBASED
 
#define OP1   dv
 
#define TYPECHECK_STACKBASED
 
#define OP1   dv
 
#define TYPECHECK_INT(s)   CHECK_STACK_TYPE(*(s), TYPE_INT)
 
#define TYPECHECK_ADR(s)   CHECK_STACK_TYPE(*(s), TYPE_ADR)
 
#define TYPECHECK_LNG(s)   CHECK_STACK_TYPE(*(s), TYPE_LNG)
 
#define TYPECHECK_FLT(s)   CHECK_STACK_TYPE(*(s), TYPE_FLT)
 
#define TYPECHECK_DBL(s)   CHECK_STACK_TYPE(*(s), TYPE_DBL)
 
#define STATE   (&state)
 
#define TYPECHECK_STACKBASED   1
 
#define STATE   (&state)
 
#define IPTR   state.iptr
 
#define BPTR   state.bptr
 
#define METHOD   state.m
 
#define LOCAL_SLOT(index)   (state.locals + (index))
 
#define EXCEPTION
 

Typedefs

typedef typedescriptor_t verifier_slot_t
 

Functions

static typecheck_result typecheck_stackbased_merge_locals (methodinfo *m, typedescriptor_t *dst, typedescriptor_t *y, int size)
 
static typecheck_result typecheck_stackbased_merge (verifier_state *state, basicblock *destblock, typedescriptor_t *stack, s4 stackdepth)
 
static bool typecheck_stackbased_reach (verifier_state *state, basicblock *destblock, typedescriptor_t *stack, s4 stackdepth)
 
static typedescriptor_ttypecheck_stackbased_verify_fieldaccess (verifier_state *state, typedescriptor_t *instance, typedescriptor_t *value, typedescriptor_t *stack)
 
static bool typecheck_stackbased_verify_invocation (verifier_state *state, typedescriptor_t *stack, typedescriptor_t *stackfloor)
 
static bool typecheck_stackbased_verify_builtin (verifier_state *state, typedescriptor_t *stack, typedescriptor_t *stackfloor)
 
static bool typecheck_stackbased_multianewarray (verifier_state *state, typedescriptor_t *stack, typedescriptor_t *stackfloor)
 
static void typecheck_stackbased_add_jsr_caller (typecheck_jsr_t *jsr, basicblock *bptr)
 
static typedescriptor_ttypecheck_stackbased_jsr (verifier_state *state, typedescriptor_t *stack, typedescriptor_t *stackfloor)
 
static bool typecheck_stackbased_ret (verifier_state *state, typedescriptor_t *stack, typedescriptor_t *stackfloor)
 
bool typecheck_stackbased (jitdata *jd)
 

Macro Definition Documentation

#define BPTR   state.bptr
#define CHECK_CAT1 (   slot)
Value:
do { \
if (!IS_CAT1(slot)) \
goto throw_stack_category_error; \
} while (0)
jlong jlong jlong jlong jint jmethodID jint slot
Definition: jvmti.h:497
#define IS_CAT1(slot)

Definition at line 127 of file typecheck-stackbased.cpp.

#define CHECK_CAT2 (   slot)
Value:
do { \
if (!IS_CAT2(slot)) \
goto throw_stack_category_error; \
} while (0)
jlong jlong jlong jlong jint jmethodID jint slot
Definition: jvmti.h:497
#define IS_CAT2(slot)

Definition at line 133 of file typecheck-stackbased.cpp.

#define CHECK_LOCAL_TYPE (   index,
 
)
Value:
do { \
if (state.locals[(index)].type != (t)) \
goto throw_local_type_error; \
if (STATE->topjsr) \
STATE->topjsr->usedlocals[(index)] = 1; \
if (STATE->topjsr && IS_2_WORD_TYPE(t)) \
STATE->topjsr->usedlocals[(index) + 1] = 1; \
} while(0)
std::size_t index
#define STATE
#define IS_2_WORD_TYPE(a)
Definition: global.hpp:132

Definition at line 83 of file typecheck-stackbased.cpp.

#define CHECK_STACK_DEPTH (   d)
Value:
if (((u1*)stack - (u1*)stackfloor) \
< (((d)-1) * (int)sizeof(verifier_slot_t))) \
goto throw_stack_underflow;
uint8_t u1
Definition: types.hpp:40
alloc::list< PassInfo::IDTy >::type & stack

Definition at line 65 of file typecheck-stackbased.cpp.

#define CHECK_STACK_SPACE (   d)
Value:
if (((u1*)STATE->stackceiling - (u1*)stack) \
< (((d)+1) * (int)sizeof(verifier_slot_t))) \
if (STATE->iptr->opc != ICMD_ACONST \
goto throw_stack_overflow;
#define STATE
uint8_t u1
Definition: types.hpp:40
alloc::list< PassInfo::IDTy >::type & stack
#define INSTRUCTION_MUST_CHECK(iptr)

Definition at line 71 of file typecheck-stackbased.cpp.

#define CHECK_STACK_TYPE (   s,
 
)
Value:
if ((s).type != (t)) \
goto throw_stack_type_error;

Definition at line 78 of file typecheck-stackbased.cpp.

#define COPY_SLOT (   s,
 
)    do { (d) = (s); } while (0)

Definition at line 139 of file typecheck-stackbased.cpp.

#define EXCEPTION   do { return NULL; } while (0)
#define EXCEPTION
Value:
do { \
OLD_LOG("EXCEPTION THROWN!\n"); \
return false; \
} while (0)
#define OLD_LOG(str)
#define return
#define IPTR   state.iptr
#define IS_CAT1 (   slot)    ((slot).type != TYPE_VOID && !IS_2_WORD_TYPE((slot).type))

Definition at line 121 of file typecheck-stackbased.cpp.

#define IS_CAT2 (   slot)    ((slot).type != TYPE_VOID && IS_2_WORD_TYPE((slot).type))

Definition at line 124 of file typecheck-stackbased.cpp.

#define LOCAL_SLOT (   index)    (state.locals + (index))
#define METHOD   state.m
#define OP1   dv
#define OP1   dv
#define REACH (   target)
Value:
do { \
} while (0)
#define REACH_BLOCK(target)
BeginInst *& block
BeginInst * target

Definition at line 149 of file typecheck-stackbased.cpp.

#define REACH_BLOCK (   target)
Value:
do { \
(stack - stackfloor) + 1)) \
return false; \
} while (0)
#define STATE
static bool typecheck_stackbased_reach(verifier_state *state, basicblock *destblock, typedescriptor_t *stack, s4 stackdepth)
alloc::list< PassInfo::IDTy >::type & stack
#define return
BeginInst * target

Definition at line 142 of file typecheck-stackbased.cpp.

#define STATE   state
#define STATE   (&state)
#define STATE   (&state)
#define STORE_LOCAL (   t,
  index 
)
Value:
do { \
state.locals[(index)].type = (t); \
if ((index) && IS_2_WORD_TYPE(state.locals[(index)-1].type)) \
state.locals[(index-1)].type = TYPE_VOID; \
if (STATE->topjsr) \
STATE->topjsr->usedlocals[(index)] = 1; \
} while (0)
std::size_t index
#define STATE
#define IS_2_WORD_TYPE(a)
Definition: global.hpp:132

Definition at line 94 of file typecheck-stackbased.cpp.

#define STORE_LOCAL_2_WORD (   t,
  index 
)
Value:
do { \
state.locals[(index)+1].type = TYPE_VOID; \
if (STATE->topjsr) \
STATE->topjsr->usedlocals[(index)] = 1; \
} while (0)
std::size_t index
#define STATE
#define STORE_LOCAL(t, index)

Definition at line 104 of file typecheck-stackbased.cpp.

#define TYPECHECK_ADR (   s)    CHECK_STACK_TYPE(*(s), TYPE_ADR)
#define TYPECHECK_DBL (   s)    CHECK_STACK_TYPE(*(s), TYPE_DBL)
#define TYPECHECK_FLT (   s)    CHECK_STACK_TYPE(*(s), TYPE_FLT)
#define TYPECHECK_INT (   s)    CHECK_STACK_TYPE(*(s), TYPE_INT)
#define TYPECHECK_LNG (   s)    CHECK_STACK_TYPE(*(s), TYPE_LNG)
#define TYPECHECK_STACKBASED
#define TYPECHECK_STACKBASED
#define TYPECHECK_STACKBASED
#define TYPECHECK_STACKBASED   1
#define VERIFY_ERROR (   msg)    VERIFY_ERROR_ret(msg,false)

Definition at line 119 of file typecheck-stackbased.cpp.

#define VERIFY_ERROR (   msg)    VERIFY_ERROR_ret(msg,NULL)

Definition at line 119 of file typecheck-stackbased.cpp.

#define VERIFY_ERROR (   msg)    VERIFY_ERROR_ret(msg,false)

Definition at line 119 of file typecheck-stackbased.cpp.

#define VERIFY_ERROR_ret (   msg,
  ret 
)
Value:
do { \
OLD_LOG1("VerifyError: %s", msg); \
return ret; \
} while (0)
void exceptions_throw_verifyerror(methodinfo *m, const char *message,...)
Definition: exceptions.cpp:973
#define STATE
#define OLD_LOG1(str, a)
#define return

Definition at line 112 of file typecheck-stackbased.cpp.

Typedef Documentation

Definition at line 55 of file typecheck-stackbased.cpp.

Function Documentation

bool typecheck_stackbased ( jitdata jd)

Definition at line 697 of file typecheck-stackbased.cpp.

static void typecheck_stackbased_add_jsr_caller ( typecheck_jsr_t jsr,
basicblock bptr 
)
static

Definition at line 529 of file typecheck-stackbased.cpp.

static typedescriptor_t* typecheck_stackbased_jsr ( verifier_state state,
typedescriptor_t stack,
typedescriptor_t stackfloor 
)
static

Definition at line 544 of file typecheck-stackbased.cpp.

static typecheck_result typecheck_stackbased_merge ( verifier_state state,
basicblock destblock,
typedescriptor_t stack,
s4  stackdepth 
)
static

Definition at line 207 of file typecheck-stackbased.cpp.

static typecheck_result typecheck_stackbased_merge_locals ( methodinfo m,
typedescriptor_t dst,
typedescriptor_t y,
int  size 
)
static

Definition at line 161 of file typecheck-stackbased.cpp.

static bool typecheck_stackbased_multianewarray ( verifier_state state,
typedescriptor_t stack,
typedescriptor_t stackfloor 
)
static

Definition at line 451 of file typecheck-stackbased.cpp.

static bool typecheck_stackbased_reach ( verifier_state state,
basicblock destblock,
typedescriptor_t stack,
s4  stackdepth 
)
static

Definition at line 274 of file typecheck-stackbased.cpp.

static bool typecheck_stackbased_ret ( verifier_state state,
typedescriptor_t stack,
typedescriptor_t stackfloor 
)
static

Definition at line 631 of file typecheck-stackbased.cpp.

static bool typecheck_stackbased_verify_builtin ( verifier_state state,
typedescriptor_t stack,
typedescriptor_t stackfloor 
)
static

Definition at line 412 of file typecheck-stackbased.cpp.

static typedescriptor_t* typecheck_stackbased_verify_fieldaccess ( verifier_state state,
typedescriptor_t instance,
typedescriptor_t value,
typedescriptor_t stack 
)
static

Definition at line 349 of file typecheck-stackbased.cpp.

static bool typecheck_stackbased_verify_invocation ( verifier_state state,
typedescriptor_t stack,
typedescriptor_t stackfloor 
)
static

Definition at line 379 of file typecheck-stackbased.cpp.