frame->imethod = rmethod;
frame->ex = NULL;
frame->ip = NULL;
- frame->invoke_trap = 0;
}
#define INIT_FRAME(frame,parent_frame,method_args,method_retval,domain,mono_method,error) do { \
init_frame ((frame), (parent_frame), _rmethod, (method_args), (method_retval)); \
} while (0)
-#define interp_exec_method(frame, context) interp_exec_method_full ((frame), (context), NULL)
+#define interp_exec_method(frame, context, error) interp_exec_method_full ((frame), (context), NULL, error)
/*
* List of classes whose methods will be executed by transitioning to JITted code.
static gboolean interp_init_done = FALSE;
-static void interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args);
+static void interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args, MonoError *error);
static InterpMethod* lookup_method_pointer (gpointer addr);
typedef void (*ICallMethod) (InterpFrame *frame);
return context;
}
-static void
+static MONO_NEVER_INLINE void
ves_real_abort (int line, MonoMethod *mh,
const unsigned short *ip, stackval *stack, stackval *sp)
{
mono_pop_lmf (&ext->lmf);
}
-static InterpMethod*
+static MONO_NEVER_INLINE InterpMethod*
get_virtual_method (InterpMethod *imethod, MonoObject *obj)
{
MonoMethod *m = imethod->method;
return pos;
}
-static void
+static MONO_NEVER_INLINE void
ves_array_set (InterpFrame *frame, stackval *sp, MonoMethodSignature *sig)
{
MonoObject *o = sp->data.o;
INIT_FRAME (&frame, NULL, args, &result, domain, invoke_wrapper, error);
- if (exc)
- frame.invoke_trap = 1;
-
- interp_exec_method (&frame, context);
+ interp_exec_method (&frame, context, error);
if (frame.ex) {
if (exc) {
break;
}
- interp_exec_method (&frame, context);
+ ERROR_DECL (error);
+ interp_exec_method (&frame, context, error);
if (rmethod->needs_thread_attach)
mono_threads_detach_coop (orig_domain, &attach_cookie);
interp_pop_lmf (&ext);
}
-static void
+static MONO_NEVER_INLINE void
copy_varargs_vtstack (MonoMethodSignature *csig, stackval *sp, unsigned char **vt_sp)
{
char *vt = *(char**)vt_sp;
/* Copy the args saved in the trampoline to the frame stack */
mono_arch_get_native_call_context_args (ccontext, &frame, sig);
- interp_exec_method (&frame, context);
+ ERROR_DECL (error);
+ interp_exec_method (&frame, context, error);
if (rmethod->needs_thread_attach)
mono_threads_detach_coop (orig_domain, &attach_cookie);
/*
* If EXIT_AT_FINALLY is not -1, exit after exiting the finally clause with that index.
* If BASE_FRAME is not NULL, copy arguments/locals from BASE_FRAME.
+ * The ERROR argument is used to avoid declaring an error object for every interp frame, its not used
+ * to return error information.
*/
static void
-interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args)
+interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClauseArgs *clause_args, MonoError *error)
{
InterpFrame child_frame;
GSList *finally_ips = NULL;
int i32;
unsigned char *vt_sp;
unsigned char *locals = NULL;
- ERROR_DECL (error);
MonoObject *o = NULL;
MonoClass *c;
#if USE_COMPUTED_GOTO
}
}
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
CHECK_RESUME_STATE (context);
child_frame.imethod = mono_interp_get_imethod (imethod->domain, m, error);
mono_error_cleanup (error); /* FIXME: don't swallow the error */
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
} else {
ves_pinvoke_method (&child_frame, csignature, (MonoFuncV) code, FALSE, context, save_last_error);
}
sp [0].data.p = unboxed;
}
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
CHECK_RESUME_STATE (context);
sp -= child_frame.imethod->param_count + child_frame.imethod->hasthis + num_varargs;
child_frame.stack_args = sp;
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
CHECK_RESUME_STATE (context);
}
}
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
CHECK_RESUME_STATE (context);
ip += 4;
}
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
CHECK_RESUME_STATE (context);
}
}
- interp_exec_method (&child_frame, context);
+ interp_exec_method (&child_frame, context, error);
CHECK_RESUME_STATE (context);
exit_frame:
+ error_init_reuse (error);
+
if (clause_args && clause_args->base_frame)
memcpy (clause_args->base_frame->args, frame->args, imethod->alloca_size);
}
}
-typedef int (*TestMethod) (void);
-
/*
* interp_set_resume_state:
*
clause_args.end_at_ip = (guint16*) handler_ip_end;
clause_args.exit_clause = clause_index;
- interp_exec_method_full (iframe, context, &clause_args);
+ ERROR_DECL (error);
+ interp_exec_method_full (iframe, context, &clause_args, error);
if (context->has_resume_state) {
return TRUE;
} else {
clause_args.filter_exception = ex;
clause_args.base_frame = iframe;
- interp_exec_method_full (&child_frame, context, &clause_args);
+ ERROR_DECL (error);
+ interp_exec_method_full (&child_frame, context, &clause_args, error);
/* ENDFILTER stores the result into child_frame->retval */
return child_frame.retval->data.i ? TRUE : FALSE;
}