char *varargs;
stackval *stack_args; /* parent */
stackval *stack;
- unsigned char *locals;
/*
* For GC tracking of local objrefs in exec_method ().
* Storing into this field will keep the object pinned
MonoException *ex;
};
+#define frame_locals(frame) (((guchar*)((frame)->stack)) + (frame)->imethod->stack_size + (frame)->imethod->vt_stack_size)
+
typedef struct {
/* Resume state for resuming execution in mixed mode */
gboolean has_resume_state;
#if DEBUG_INTERP
vtalloc = vt_sp;
#endif
- locals = (unsigned char *) vt_sp + imethod->vt_stack_size;
- frame->locals = locals;
+ locals = frame_locals (frame);
child_frame.parent = frame;
if (clause_args && clause_args->filter_exception) {
DUMP_INSTR();
MINT_IN_SWITCH (*ip) {
MINT_IN_CASE(MINT_INITLOCALS)
- memset (locals, 0, imethod->locals_size);
+ memset (frame_locals (frame), 0, imethod->locals_size);
++ip;
MINT_IN_BREAK;
MINT_IN_CASE(MINT_NOP)
#if DEBUG_INTERP
vtalloc = vt_sp;
#endif
- locals = vt_sp + imethod->vt_stack_size;
- frame->locals = locals;
+ locals = frame_locals (frame);
ip = imethod->code;
MINT_IN_BREAK;
}
#endif
MINT_IN_CASE(MINT_RETHROW) {
int exvar_offset = *(guint16*)(ip + 1);
- THROW_EX_GENERAL (*(MonoException**)(frame->locals + exvar_offset), ip, TRUE);
+ THROW_EX_GENERAL (*(MonoException**)(frame_locals (frame) + exvar_offset), ip, TRUE);
MINT_IN_BREAK;
}
MINT_IN_CASE(MINT_MONO_RETHROW) {
context->handler_frame->ex = ex;
/* Ditto */
if (ei)
- *(MonoException**)(context->handler_frame->locals + ei->exvar_offset) = ex;
+ *(MonoException**)(frame_locals (context->handler_frame) + ei->exvar_offset) = ex;
context->handler_ip = (guint16*) handler_ip;
}
g_assert (iframe->imethod);
- return iframe->locals + iframe->imethod->local_offsets [pos];
+ return frame_locals (iframe) + iframe->imethod->local_offsets [pos];
}
static gpointer