[interp] Rename some types to better reflect their function.
authorZoltan Varga <vargaz@gmail.com>
Wed, 26 Jul 2017 01:46:44 +0000 (21:46 -0400)
committerBernhard Urban <bernhard.urban@xamarin.com>
Thu, 27 Jul 2017 12:23:08 +0000 (14:23 +0200)
MonoInvocation -> InterpFrame
RuntimeMethod -> InterpMethod
runtime_method -> imethod

mono/mini/interp/interp-internals.h
mono/mini/interp/interp.c
mono/mini/interp/transform.c

index 60d91afd44426284352754e64eef1793af91821f..e566f535a6eeada977e7abffc27839e953a10125 100644 (file)
@@ -54,7 +54,7 @@ typedef struct {
 #endif
 } stackval;
 
-typedef struct _MonoInvocation MonoInvocation;
+typedef struct _InterpFrame InterpFrame;
 
 typedef void (*MonoFuncV) (void);
 typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
@@ -63,14 +63,14 @@ typedef void (*MonoPIFunc) (MonoFuncV callme, void *margs);
  * Structure representing a method transformed for the interpreter 
  * This is domain specific
  */
-typedef struct _RuntimeMethod
+typedef struct _InterpMethod
 {
        /* NOTE: These first two elements (method and
           next_jit_code_hash) must be in the same order and at the
           same offset as in MonoJitInfo, because of the jit_code_hash
           internal hash table in MonoDomain. */
        MonoMethod *method;
-       struct _RuntimeMethod *next_jit_code_hash;
+       struct _InterpMethod *next_jit_code_hash;
        guint32 locals_size;
        guint32 args_size;
        guint32 stack_size;
@@ -96,11 +96,11 @@ typedef struct _RuntimeMethod
        MonoType **param_types;
        MonoJitInfo *jinfo;
        MonoDomain *domain;
-} RuntimeMethod;
+} InterpMethod;
 
-struct _MonoInvocation {
-       MonoInvocation *parent; /* parent */
-       RuntimeMethod  *runtime_method; /* parent */
+struct _InterpFrame {
+       InterpFrame *parent; /* parent */
+       InterpMethod  *imethod; /* parent */
        MonoMethod     *method; /* parent */
        stackval       *retval; /* parent */
        char           *args;
@@ -117,9 +117,9 @@ struct _MonoInvocation {
 
 typedef struct {
        MonoDomain *original_domain;
-       MonoInvocation *base_frame;
-       MonoInvocation *current_frame;
-       MonoInvocation *env_frame;
+       InterpFrame *base_frame;
+       InterpFrame *current_frame;
+       InterpFrame *env_frame;
        jmp_buf *current_env;
        unsigned char search_for_handler;
        unsigned char managed_code;
@@ -127,7 +127,7 @@ typedef struct {
        /* Resume state for resuming execution in mixed mode */
        gboolean       has_resume_state;
        /* Frame to resume execution at */
-       MonoInvocation *handler_frame;
+       InterpFrame *handler_frame;
        /* IP to resume execution at */
        gpointer handler_ip;
 } ThreadContext;
@@ -136,12 +136,12 @@ extern int mono_interp_traceopt;
 extern GSList *jit_classes;
 
 MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context);
+mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context);
 
 void
 mono_interp_transform_init (void);
 
-RuntimeMethod *
-mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error);
+InterpMethod *
+mono_interp_get_imethod (MonoDomain *domain, MonoMethod *method, MonoError *error);
 
 #endif /* __MONO_MINI_INTERPRETER_INTERNALS_H__ */
index 45bb8188f42c07c2447413f0219dbce350fac7a7..e5d50d5aa5e98a0f17b0234f1c03fe5174f08c64 100644 (file)
 #endif
 
 static inline void
-init_frame (MonoInvocation *frame, MonoInvocation *parent_frame, RuntimeMethod *rmethod, stackval *method_args, stackval *method_retval)
+init_frame (InterpFrame *frame, InterpFrame *parent_frame, InterpMethod *rmethod, stackval *method_args, stackval *method_retval)
 {
        frame->parent = parent_frame;
        frame->stack_args = method_args;
        frame->retval = method_retval;
-       frame->runtime_method = rmethod;
+       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 { \
-       RuntimeMethod *_rmethod = mono_interp_get_runtime_method ((domain), (mono_method), (error));    \
+       InterpMethod *_rmethod = mono_interp_get_imethod ((domain), (mono_method), (error));    \
        init_frame ((frame), (parent_frame), _rmethod, (method_args), (method_retval)); \
        } while (0)
 
@@ -108,18 +108,18 @@ GSList *jit_classes;
 /* If TRUE, interpreted code will be interrupted at function entry/backward branches */
 static gboolean ss_enabled;
 
-void ves_exec_method (MonoInvocation *frame);
+void ves_exec_method (InterpFrame *frame);
 
-static char* dump_frame (MonoInvocation *inv);
-static MonoArray *get_trace_ips (MonoDomain *domain, MonoInvocation *top);
-static void ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally);
+static char* dump_frame (InterpFrame *inv);
+static MonoArray *get_trace_ips (MonoDomain *domain, InterpFrame *top);
+static void ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally);
 
-typedef void (*ICallMethod) (MonoInvocation *frame);
+typedef void (*ICallMethod) (InterpFrame *frame);
 
 static guint32 die_on_exception = 0;
 static MonoNativeTlsKey thread_context_id;
 
-static char* dump_args (MonoInvocation *inv);
+static char* dump_args (InterpFrame *inv);
 
 #define DEBUG_INTERP 0
 #define COUNT_OPS 0
@@ -154,16 +154,16 @@ db_match_method (gpointer data, gpointer user_data)
 }
 
 static void
-debug_enter (MonoInvocation *frame, int *tracing)
+debug_enter (InterpFrame *frame, int *tracing)
 {
        if (db_methods) {
-               g_list_foreach (db_methods, db_match_method, (gpointer)frame->runtime_method->method);
+               g_list_foreach (db_methods, db_match_method, (gpointer)frame->imethod->method);
                if (break_on_method)
                        *tracing = nested_trace ? (global_tracing = 2, 3) : 2;
                break_on_method = 0;
        }
        if (*tracing) {
-               MonoMethod *method = frame->runtime_method->method;
+               MonoMethod *method = frame->imethod->method;
                char *mn, *args = dump_args (frame);
                debug_indent_level++;
                output_indent ();
@@ -173,8 +173,8 @@ debug_enter (MonoInvocation *frame, int *tracing)
                g_print  ("%s)\n", args);
                g_free (args);
        }
-       if (mono_profiler_should_instrument_method (frame->runtime_method->method, TRUE))
-               MONO_PROFILER_RAISE (method_enter, (frame->runtime_method->method));
+       if (mono_profiler_should_instrument_method (frame->imethod->method, TRUE))
+               MONO_PROFILER_RAISE (method_enter, (frame->imethod->method));
 }
 
 
@@ -183,7 +183,7 @@ debug_enter (MonoInvocation *frame, int *tracing)
                char *mn, *args;        \
                args = dump_retval (frame);     \
                output_indent ();       \
-               mn = mono_method_full_name (frame->runtime_method->method, FALSE); \
+               mn = mono_method_full_name (frame->imethod->method, FALSE); \
                g_print  ("(%p) Leaving %s", mono_thread_internal_current (),  mn);     \
                g_free (mn); \
                g_print  (" => %s\n", args);    \
@@ -191,13 +191,13 @@ debug_enter (MonoInvocation *frame, int *tracing)
                debug_indent_level--;   \
                if (tracing == 3) global_tracing = 0; \
        }       \
-       if (mono_profiler_should_instrument_method (frame->runtime_method->method, FALSE)) \
-               MONO_PROFILER_RAISE (method_leave, (frame->runtime_method->method));
+       if (mono_profiler_should_instrument_method (frame->imethod->method, FALSE)) \
+               MONO_PROFILER_RAISE (method_leave, (frame->imethod->method));
 
 #else
 
 int mono_interp_traceopt = 0;
-static void debug_enter (MonoInvocation *frame, int *tracing)
+static void debug_enter (InterpFrame *frame, int *tracing)
 {
 }
 #define DEBUG_LEAVE()
@@ -246,14 +246,14 @@ ves_real_abort (int line, MonoMethod *mh,
 
 #define ves_abort() \
        do {\
-               ves_real_abort(__LINE__, frame->runtime_method->method, ip, frame->stack, sp); \
+               ves_real_abort(__LINE__, frame->imethod->method, ip, frame->stack, sp); \
                THROW_EX (mono_get_exception_execution_engine (NULL), ip); \
        } while (0);
 
-static RuntimeMethod*
-lookup_runtime_method (MonoDomain *domain, MonoMethod *method)
+static InterpMethod*
+lookup_imethod (MonoDomain *domain, MonoMethod *method)
 {
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
        MonoJitDomainInfo *info;
 
        info = domain_jit_info (domain);
@@ -263,10 +263,10 @@ lookup_runtime_method (MonoDomain *domain, MonoMethod *method)
        return rtm;
 }
 
-RuntimeMethod*
-mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error)
+InterpMethod*
+mono_interp_get_imethod (MonoDomain *domain, MonoMethod *method, MonoError *error)
 {
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
        MonoJitDomainInfo *info;
        MonoMethodSignature *sig;
        int i;
@@ -282,7 +282,7 @@ mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoErro
 
        sig = mono_method_signature (method);
 
-       rtm = mono_domain_alloc0 (domain, sizeof (RuntimeMethod));
+       rtm = mono_domain_alloc0 (domain, sizeof (InterpMethod));
        rtm->method = method;
        rtm->domain = domain;
        rtm->param_count = sig->param_count;
@@ -305,7 +305,7 @@ mono_interp_create_trampoline (MonoDomain *domain, MonoMethod *method, MonoError
 {
        if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
                method = mono_marshal_get_synchronized_wrapper (method);
-       return mono_interp_get_runtime_method (domain, method, error);
+       return mono_interp_get_imethod (domain, method, error);
 }
 
 /*
@@ -317,7 +317,7 @@ mono_interp_create_trampoline (MonoDomain *domain, MonoMethod *method, MonoError
  * be able to do stack walks.
  */
 static void
-interp_push_lmf (MonoLMFExt *ext, MonoInvocation *frame)
+interp_push_lmf (MonoLMFExt *ext, InterpFrame *frame)
 {
        memset (ext, 0, sizeof (MonoLMFExt));
        ext->interp_exit = TRUE;
@@ -332,17 +332,17 @@ interp_pop_lmf (MonoLMFExt *ext)
        mono_pop_lmf (&ext->lmf);
 }
 
-static inline RuntimeMethod*
-get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
+static inline InterpMethod*
+get_virtual_method (InterpMethod *imethod, MonoObject *obj)
 {
-       MonoMethod *m = runtime_method->method;
-       MonoDomain *domain = runtime_method->domain;
-       RuntimeMethod *ret = NULL;
+       MonoMethod *m = imethod->method;
+       MonoDomain *domain = imethod->domain;
+       InterpMethod *ret = NULL;
        MonoError error;
 
 #ifndef DISABLE_REMOTING
        if (mono_object_is_transparent_proxy (obj)) {
-               ret = mono_interp_get_runtime_method (domain, mono_marshal_get_remoting_invoke (m), &error);
+               ret = mono_interp_get_imethod (domain, mono_marshal_get_remoting_invoke (m), &error);
                mono_error_assert_ok (&error);
                return ret;
        }
@@ -350,10 +350,10 @@ get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
 
        if ((m->flags & METHOD_ATTRIBUTE_FINAL) || !(m->flags & METHOD_ATTRIBUTE_VIRTUAL)) {
                if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
-                       ret = mono_interp_get_runtime_method (domain, mono_marshal_get_synchronized_wrapper (m), &error);
+                       ret = mono_interp_get_imethod (domain, mono_marshal_get_synchronized_wrapper (m), &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                } else {
-                       ret = runtime_method;
+                       ret = imethod;
                }
                return ret;
        }
@@ -386,9 +386,9 @@ get_virtual_method (RuntimeMethod *runtime_method, MonoObject *obj)
                virtual_method = mono_marshal_get_synchronized_wrapper (virtual_method);
        }
 
-       RuntimeMethod *virtual_runtime_method = mono_interp_get_runtime_method (domain, virtual_method, &error);
+       InterpMethod *virtual_imethod = mono_interp_get_imethod (domain, virtual_method, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-       return virtual_runtime_method;
+       return virtual_imethod;
 }
 
 static void inline
@@ -583,11 +583,11 @@ stackval_to_data (MonoType *type, stackval *val, char *data, gboolean pinvoke)
 }
 
 static void
-fill_in_trace (MonoException *exception, MonoInvocation *frame)
+fill_in_trace (MonoException *exception, InterpFrame *frame)
 {
        MonoError error;
        char *stack_trace = dump_frame (frame);
-       MonoDomain *domain = frame->runtime_method->domain;
+       MonoDomain *domain = frame->imethod->domain;
        (exception)->stack_trace = mono_string_new_checked (domain, stack_trace, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
        (exception)->trace_ips = get_trace_ips (domain, frame);
@@ -609,7 +609,7 @@ fill_in_trace (MonoException *exception, MonoInvocation *frame)
 #define THROW_EX(exception,ex_ip) THROW_EX_GENERAL ((exception), (ex_ip), FALSE)
 
 static MonoObject*
-ves_array_create (MonoInvocation *frame, MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
+ves_array_create (InterpFrame *frame, MonoDomain *domain, MonoClass *klass, MonoMethodSignature *sig, stackval *values)
 {
        uintptr_t *lengths;
        intptr_t *lower_bounds;
@@ -640,7 +640,7 @@ ves_array_create (MonoInvocation *frame, MonoDomain *domain, MonoClass *klass, M
 }
 
 static gint32
-ves_array_calculate_index (MonoArray *ao, stackval *sp, MonoInvocation *frame, gboolean safe)
+ves_array_calculate_index (MonoArray *ao, stackval *sp, InterpFrame *frame, gboolean safe)
 {
        g_assert (!frame->ex);
        MonoClass *ac = ((MonoObject *) ao)->vtable->klass;
@@ -670,7 +670,7 @@ ves_array_calculate_index (MonoArray *ao, stackval *sp, MonoInvocation *frame, g
 }
 
 static void
-ves_array_set (MonoInvocation *frame)
+ves_array_set (InterpFrame *frame)
 {
        stackval *sp = frame->stack_args + 1;
 
@@ -698,12 +698,12 @@ ves_array_set (MonoInvocation *frame)
        gint32 esize = mono_array_element_size (ac);
        gpointer ea = mono_array_addr_with_size (ao, esize, pos);
 
-       MonoType *mt = mono_method_signature (frame->runtime_method->method)->params [ac->rank];
+       MonoType *mt = mono_method_signature (frame->imethod->method)->params [ac->rank];
        stackval_to_data (mt, &sp [ac->rank], ea, FALSE);
 }
 
 static void
-ves_array_get (MonoInvocation *frame, gboolean safe)
+ves_array_get (InterpFrame *frame, gboolean safe)
 {
        stackval *sp = frame->stack_args + 1;
 
@@ -720,12 +720,12 @@ ves_array_get (MonoInvocation *frame, gboolean safe)
        gint32 esize = mono_array_element_size (ac);
        gpointer ea = mono_array_addr_with_size (ao, esize, pos);
 
-       MonoType *mt = mono_method_signature (frame->runtime_method->method)->ret;
+       MonoType *mt = mono_method_signature (frame->imethod->method)->ret;
        stackval_from_data (mt, frame->retval, ea, FALSE);
 }
 
 static gpointer
-ves_array_element_address (MonoInvocation *frame, MonoClass *required_type, MonoArray *ao, stackval *sp, gboolean needs_typecheck)
+ves_array_element_address (InterpFrame *frame, MonoClass *required_type, MonoArray *ao, stackval *sp, gboolean needs_typecheck)
 {
        MonoClass *ac = ((MonoObject *) ao)->vtable->klass;
 
@@ -753,17 +753,17 @@ interp_walk_stack_with_ctx (MonoInternalStackWalk func, MonoContext *ctx, MonoUn
        if (!context)
                return;
 
-       MonoInvocation *frame = context->current_frame;
+       InterpFrame *frame = context->current_frame;
 
        while (frame) {
                MonoStackFrameInfo fi;
                memset (&fi, 0, sizeof (MonoStackFrameInfo));
 
                /* TODO: hack to make some asserts happy. */
-               fi.ji = (MonoJitInfo *) frame->runtime_method;
+               fi.ji = (MonoJitInfo *) frame->imethod;
 
-               if (frame->runtime_method)
-                       fi.method = fi.actual_method = frame->runtime_method->method;
+               if (frame->imethod)
+                       fi.method = fi.actual_method = frame->imethod->method;
 
                if (!fi.method || (fi.method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) || (fi.method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))) {
                        fi.il_offset = -1;
@@ -785,7 +785,7 @@ interp_walk_stack_with_ctx (MonoInternalStackWalk func, MonoContext *ctx, MonoUn
 
 static MonoPIFunc mono_interp_enter_icall_trampoline = NULL;
 
-static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, MonoInvocation *frame)
+static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, InterpFrame *frame)
 {
        InterpMethodArguments *margs = g_malloc0 (sizeof (InterpMethodArguments));
 
@@ -974,11 +974,11 @@ static InterpMethodArguments* build_args_from_sig (MonoMethodSignature *sig, Mon
 }
 
 static void 
-ves_pinvoke_method (MonoInvocation *frame, MonoMethodSignature *sig, MonoFuncV addr, gboolean string_ctor, ThreadContext *context)
+ves_pinvoke_method (InterpFrame *frame, MonoMethodSignature *sig, MonoFuncV addr, gboolean string_ctor, ThreadContext *context)
 {
        jmp_buf env;
-       MonoInvocation *old_frame = context->current_frame;
-       MonoInvocation *old_env_frame = context->env_frame;
+       InterpFrame *old_frame = context->current_frame;
+       InterpFrame *old_env_frame = context->env_frame;
        jmp_buf *old_env = context->current_env;
        MonoLMFExt ext;
 
@@ -994,7 +994,7 @@ ves_pinvoke_method (MonoInvocation *frame, MonoMethodSignature *sig, MonoFuncV a
        context->env_frame = frame;
        context->current_env = &env;
 
-       g_assert (!frame->runtime_method);
+       g_assert (!frame->imethod);
        if (!mono_interp_enter_icall_trampoline) {
                if (mono_aot_only) {
                        mono_interp_enter_icall_trampoline = mono_aot_get_trampoline ("enter_icall_trampoline");
@@ -1049,7 +1049,7 @@ mono_interp_init_delegate (MonoDelegate *del)
        if (del->method)
                return;
        /* shouldn't need a write barrier because we don't write a MonoObject into the field */
-       del->method = ((RuntimeMethod *) del->method_ptr)->method;
+       del->method = ((InterpMethod *) del->method_ptr)->method;
 }
 
 /*
@@ -1058,9 +1058,9 @@ mono_interp_init_delegate (MonoDelegate *del)
  * provided by the runtime and is primarily used for the methods of delegates.
  */
 static void
-ves_runtime_method (MonoInvocation *frame, ThreadContext *context)
+ves_imethod (InterpFrame *frame, ThreadContext *context)
 {
-       MonoMethod *method = frame->runtime_method->method;
+       MonoMethod *method = frame->imethod->method;
        const char *name = method->name;
        MonoObject *obj = (MonoObject*) frame->stack_args->data.p;
        MonoObject *isinst_obj;
@@ -1165,10 +1165,10 @@ dump_stackval (GString *str, stackval *s, MonoType *type)
 
 #if DEBUG_INTERP
 static char*
-dump_retval (MonoInvocation *inv)
+dump_retval (InterpFrame *inv)
 {
        GString *str = g_string_new ("");
-       MonoType *ret = mono_method_signature (inv->runtime_method->method)->ret;
+       MonoType *ret = mono_method_signature (inv->imethod->method)->ret;
 
        if (ret->type != MONO_TYPE_VOID)
                dump_stackval (str, inv->retval, ret);
@@ -1178,17 +1178,17 @@ dump_retval (MonoInvocation *inv)
 #endif
 
 static char*
-dump_args (MonoInvocation *inv)
+dump_args (InterpFrame *inv)
 {
        GString *str = g_string_new ("");
        int i;
-       MonoMethodSignature *signature = mono_method_signature (inv->runtime_method->method);
+       MonoMethodSignature *signature = mono_method_signature (inv->imethod->method);
        
        if (signature->param_count == 0 && !signature->hasthis)
                return g_string_free (str, FALSE);
 
        if (signature->hasthis) {
-               MonoMethod *method = inv->runtime_method->method;
+               MonoMethod *method = inv->imethod->method;
                dump_stackval (str, inv->stack_args, &method->klass->byval_arg);
        }
 
@@ -1199,7 +1199,7 @@ dump_args (MonoInvocation *inv)
 }
  
 static char*
-dump_frame (MonoInvocation *inv)
+dump_frame (InterpFrame *inv)
 {
        GString *str = g_string_new ("");
        int i;
@@ -1207,8 +1207,8 @@ dump_frame (MonoInvocation *inv)
        MonoError error;
 
        for (i = 0; inv; inv = inv->parent) {
-               if (inv->runtime_method != NULL) {
-                       MonoMethod *method = inv->runtime_method->method;
+               if (inv->imethod != NULL) {
+                       MonoMethod *method = inv->imethod->method;
                        MonoClass *k;
 
                        int codep = 0;
@@ -1226,7 +1226,7 @@ dump_frame (MonoInvocation *inv)
                                if (hd != NULL) {
                                        if (inv->ip) {
                                                opname = mono_interp_opname [*inv->ip];
-                                               codep = inv->ip - inv->runtime_method->code;
+                                               codep = inv->ip - inv->imethod->code;
                                                source = g_strdup_printf ("%s:%d // (TODO: proper stacktrace)", method->name, codep);
                                        } else 
                                                opname = "";
@@ -1253,23 +1253,23 @@ dump_frame (MonoInvocation *inv)
 }
 
 static MonoArray *
-get_trace_ips (MonoDomain *domain, MonoInvocation *top)
+get_trace_ips (MonoDomain *domain, InterpFrame *top)
 {
        int i;
        MonoArray *res;
-       MonoInvocation *inv;
+       InterpFrame *inv;
        MonoError error;
 
        for (i = 0, inv = top; inv; inv = inv->parent)
-               if (inv->runtime_method != NULL)
+               if (inv->imethod != NULL)
                        ++i;
 
        res = mono_array_new_checked (domain, mono_defaults.int_class, 2 * i, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
 
        for (i = 0, inv = top; inv; inv = inv->parent)
-               if (inv->runtime_method != NULL) {
-                       mono_array_set (res, gpointer, i, inv->runtime_method);
+               if (inv->imethod != NULL) {
+                       mono_array_set (res, gpointer, i, inv->imethod);
                        ++i;
                        mono_array_set (res, gpointer, i, (gpointer)inv->ip);
                        ++i;
@@ -1361,7 +1361,7 @@ get_trace_ips (MonoDomain *domain, MonoInvocation *top)
 MonoObject*
 mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error)
 {
-       MonoInvocation frame;
+       InterpFrame frame;
        ThreadContext * volatile context = mono_native_tls_get_value (thread_context_id);
        MonoObject *retval = NULL;
        MonoMethodSignature *sig = mono_method_signature (method);
@@ -1369,7 +1369,7 @@ mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoOb
        stackval result;
        stackval *args;
        ThreadContext context_struct;
-       MonoInvocation *old_frame = NULL;
+       InterpFrame *old_frame = NULL;
        jmp_buf env;
 
        error_init (error);
@@ -1444,7 +1444,7 @@ mono_interp_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoOb
 }
 
 typedef struct {
-       RuntimeMethod *rmethod;
+       InterpMethod *rmethod;
        gpointer this_arg;
        gpointer res;
        gpointer args [16];
@@ -1455,11 +1455,11 @@ typedef struct {
 static void
 interp_entry (InterpEntryData *data)
 {
-       MonoInvocation frame;
-       RuntimeMethod *rmethod = data->rmethod;
+       InterpFrame frame;
+       InterpMethod *rmethod = data->rmethod;
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
        ThreadContext context_struct;
-       MonoInvocation *old_frame;
+       InterpFrame *old_frame;
        stackval result;
        stackval *args;
        MonoMethod *method;
@@ -1648,8 +1648,8 @@ interp_entry (InterpEntryData *data)
 static stackval * 
 do_icall (ThreadContext *context, int op, stackval *sp, gpointer ptr)
 {
-       MonoInvocation *old_frame = context->current_frame;
-       MonoInvocation *old_env_frame = context->env_frame;
+       InterpFrame *old_frame = context->current_frame;
+       InterpFrame *old_env_frame = context->env_frame;
        jmp_buf *old_env = context->current_env;
        jmp_buf env;
 
@@ -1735,7 +1735,7 @@ do_icall (ThreadContext *context, int op, stackval *sp, gpointer ptr)
 }
 
 static stackval *
-do_jit_call (stackval *sp, unsigned char *vt_sp, ThreadContext *context, MonoInvocation *frame, RuntimeMethod *rmethod)
+do_jit_call (stackval *sp, unsigned char *vt_sp, ThreadContext *context, InterpFrame *frame, InterpMethod *rmethod)
 {
        MonoMethodSignature *sig;
        MonoFtnDesc ftndesc;
@@ -1946,7 +1946,7 @@ do_jit_call (stackval *sp, unsigned char *vt_sp, ThreadContext *context, MonoInv
 }
 
 static void
-do_debugger_tramp (void (*tramp) (void), MonoInvocation *frame)
+do_debugger_tramp (void (*tramp) (void), InterpFrame *frame)
 {
        MonoLMFExt ext;
        interp_push_lmf (&ext, frame);
@@ -1955,14 +1955,14 @@ do_debugger_tramp (void (*tramp) (void), MonoInvocation *frame)
 }
 
 static void
-do_transform_method (MonoInvocation *frame, ThreadContext *context)
+do_transform_method (InterpFrame *frame, ThreadContext *context)
 {
        MonoLMFExt ext;
 
        /* Use the parent frame as the current frame is not complete yet */
        interp_push_lmf (&ext, frame->parent);
 
-       frame->ex = mono_interp_transform_method (frame->runtime_method, context);
+       frame->ex = mono_interp_transform_method (frame->imethod, context);
        context->managed_code = 1;
 
        interp_pop_lmf (&ext);
@@ -2060,15 +2060,15 @@ do_transform_method (MonoInvocation *frame, ThreadContext *context)
        interp_entry (&data); \
        }
 
-#define ARGLIST0 RuntimeMethod *rmethod
-#define ARGLIST1 gpointer arg1, RuntimeMethod *rmethod
-#define ARGLIST2 gpointer arg1, gpointer arg2, RuntimeMethod *rmethod
-#define ARGLIST3 gpointer arg1, gpointer arg2, gpointer arg3, RuntimeMethod *rmethod
-#define ARGLIST4 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, RuntimeMethod *rmethod
-#define ARGLIST5 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, RuntimeMethod *rmethod
-#define ARGLIST6 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, RuntimeMethod *rmethod
-#define ARGLIST7 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, RuntimeMethod *rmethod
-#define ARGLIST8 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, gpointer arg8, RuntimeMethod *rmethod
+#define ARGLIST0 InterpMethod *rmethod
+#define ARGLIST1 gpointer arg1, InterpMethod *rmethod
+#define ARGLIST2 gpointer arg1, gpointer arg2, InterpMethod *rmethod
+#define ARGLIST3 gpointer arg1, gpointer arg2, gpointer arg3, InterpMethod *rmethod
+#define ARGLIST4 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, InterpMethod *rmethod
+#define ARGLIST5 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, InterpMethod *rmethod
+#define ARGLIST6 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, InterpMethod *rmethod
+#define ARGLIST7 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, InterpMethod *rmethod
+#define ARGLIST8 gpointer arg1, gpointer arg2, gpointer arg3, gpointer arg4, gpointer arg5, gpointer arg6, gpointer arg7, gpointer arg8, InterpMethod *rmethod
 
 static void interp_entry_static_0 (ARGLIST0) INTERP_ENTRY0 (NULL, NULL, rmethod)
 static void interp_entry_static_1 (ARGLIST1) INTERP_ENTRY1 (NULL, NULL, rmethod)
@@ -2135,7 +2135,7 @@ mono_interp_create_method_pointer (MonoMethod *method, MonoError *error)
        gpointer addr;
        MonoMethodSignature *sig = mono_method_signature (method);
        MonoMethod *wrapper;
-       RuntimeMethod *rmethod = mono_interp_get_runtime_method (mono_domain_get (), method, error);
+       InterpMethod *rmethod = mono_interp_get_imethod (mono_domain_get (), method, error);
 
        /* HACK: method_ptr of delegate should point to a runtime method*/
        if (method->wrapper_type && method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
@@ -2206,7 +2206,7 @@ static int opcode_counts[512];
                } \
                sp->data.l = 0; \
                output_indent (); \
-               char *mn = mono_method_full_name (frame->runtime_method->method, FALSE); \
+               char *mn = mono_method_full_name (frame->imethod->method, FALSE); \
                g_print ("(%p) %s -> ", mono_thread_internal_current (), mn); \
                g_free (mn); \
                mono_interp_dis_mintop(rtm->code, ip); \
@@ -2240,14 +2240,14 @@ static int opcode_counts[512];
  * If EXIT_AT_FINALLY is not -1, exit after exiting the finally clause with that index.
  */
 static void 
-ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally)
+ves_exec_method_with_context (InterpFrame *frame, ThreadContext *context, unsigned short *start_with_ip, MonoException *filter_exception, int exit_at_finally)
 {
-       MonoInvocation child_frame;
+       InterpFrame child_frame;
        GSList *finally_ips = NULL;
        const unsigned short *endfinally_ip = NULL;
        const unsigned short *ip = NULL;
        register stackval *sp;
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
 #if DEBUG_INTERP
        gint tracing = global_tracing;
        unsigned char *vtalloc;
@@ -2275,10 +2275,10 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
 
        debug_enter (frame, &tracing);
 
-       if (!frame->runtime_method->transformed) {
+       if (!frame->imethod->transformed) {
                context->managed_code = 0;
 #if DEBUG_INTERP
-               char *mn = mono_method_full_name (frame->runtime_method->method, TRUE);
+               char *mn = mono_method_full_name (frame->imethod->method, TRUE);
                g_print ("(%p) Transforming %s\n", mono_thread_internal_current (), mn);
                g_free (mn);
 #endif
@@ -2291,7 +2291,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                }
        }
 
-       rtm = frame->runtime_method;
+       rtm = frame->imethod;
        if (!start_with_ip ) {
                frame->args = alloca (rtm->alloca_size);
                memset (frame->args, 0, rtm->alloca_size);
@@ -2436,7 +2436,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_JMP) {
-                       RuntimeMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
+                       InterpMethod *new_method = rtm->data_items [* (guint16 *)(ip + 1)];
                        if (!new_method->transformed) {
                                frame->ip = ip;
                                frame->ex = mono_interp_transform_method (new_method, context);
@@ -2446,7 +2446,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        ip += 2;
                        if (new_method->alloca_size > rtm->alloca_size)
                                g_error ("MINT_JMP to method which needs more stack space (%d > %d)", new_method->alloca_size, rtm->alloca_size); 
-                       rtm = frame->runtime_method = new_method;
+                       rtm = frame->imethod = new_method;
                        vt_sp = (unsigned char *) sp + rtm->stack_size;
 #if DEBUG_INTERP
                        vtalloc = vt_sp;
@@ -2466,7 +2466,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        ip += 2;
                        --sp;
                        --endsp;
-                       child_frame.runtime_method = sp->data.p;
+                       child_frame.imethod = sp->data.p;
 
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
@@ -2479,12 +2479,12 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
 #ifndef DISABLE_REMOTING
                        /* `this' can be NULL for string:.ctor */
                        if (csignature->hasthis && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.imethod->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        } else
 #endif
-                       if (child_frame.runtime_method->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_native_wrapper (child_frame.runtime_method->method, FALSE, FALSE), &error);
+                       if (child_frame.imethod->method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) {
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_native_wrapper (child_frame.imethod->method, FALSE, FALSE), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 
@@ -2535,7 +2535,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        --sp;
                        --endsp;
                        code = sp->data.p;
-                       child_frame.runtime_method = NULL;
+                       child_frame.imethod = NULL;
 
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
@@ -2579,20 +2579,20 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
 
                        frame->ip = ip;
                        
-                       child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
+                       child_frame.imethod = rtm->data_items [* (guint16 *)(ip + 1)];
                        ip += 2;
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count;
-                       if (child_frame.runtime_method->hasthis)
+                       sp -= child_frame.imethod->param_count;
+                       if (child_frame.imethod->hasthis)
                                --sp;
                        child_frame.stack_args = sp;
 
 #ifndef DISABLE_REMOTING
                        /* `this' can be NULL for string:.ctor */
-                       if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->method->klass->valuetype && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
+                       if (child_frame.imethod->hasthis && !child_frame.imethod->method->klass->valuetype && sp->data.p && mono_object_is_transparent_proxy (sp->data.p)) {
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.imethod->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 #endif
@@ -2624,14 +2624,14 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                MINT_IN_CASE(MINT_VCALL) {
                        frame->ip = ip;
                        
-                       child_frame.runtime_method = rtm->data_items [* (guint16 *)(ip + 1)];
+                       child_frame.imethod = rtm->data_items [* (guint16 *)(ip + 1)];
                        ip += 2;
 
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count;
-                       if (child_frame.runtime_method->hasthis) {
+                       sp -= child_frame.imethod->param_count;
+                       if (child_frame.imethod->hasthis) {
                                --sp;
                                MonoObject *this_arg = sp->data.p;
                                if (!this_arg)
@@ -2640,8 +2640,8 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        child_frame.stack_args = sp;
 
 #ifndef DISABLE_REMOTING
-                       if (child_frame.runtime_method->hasthis && !child_frame.runtime_method->method->klass->valuetype && mono_object_is_transparent_proxy (sp->data.p)) {
-                               child_frame.runtime_method = mono_interp_get_runtime_method (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.runtime_method->method), &error);
+                       if (child_frame.imethod->hasthis && !child_frame.imethod->method->klass->valuetype && mono_object_is_transparent_proxy (sp->data.p)) {
+                               child_frame.imethod = mono_interp_get_imethod (rtm->domain, mono_marshal_get_remoting_invoke (child_frame.imethod->method), &error);
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
 #endif
@@ -2668,7 +2668,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                }
 
                MINT_IN_CASE(MINT_JIT_CALL) {
-                       RuntimeMethod *rmethod = rtm->data_items [* (guint16 *)(ip + 1)];
+                       InterpMethod *rmethod = rtm->data_items [* (guint16 *)(ip + 1)];
                        frame->ip = ip;
                        ip += 2;
                        sp = do_jit_call (sp, vt_sp, context, frame, rmethod);
@@ -2700,20 +2700,20 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        
                        token = * (unsigned short *)(ip + 1);
                        ip += 2;
-                       child_frame.runtime_method = rtm->data_items [token];
+                       child_frame.imethod = rtm->data_items [token];
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
 
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count + 1;
+                       sp -= child_frame.imethod->param_count + 1;
                        child_frame.stack_args = sp;
                        this_arg = sp->data.p;
                        if (!this_arg)
                                THROW_EX (mono_get_exception_null_reference(), ip - 2);
-                       child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
+                       child_frame.imethod = get_virtual_method (child_frame.imethod, this_arg);
 
                        MonoClass *this_class = this_arg->vtable->klass;
-                       if (this_class->valuetype && child_frame.runtime_method->method->klass->valuetype) {
+                       if (this_class->valuetype && child_frame.imethod->method->klass->valuetype) {
                                /* unbox */
                                gpointer *unboxed = mono_object_unbox (this_arg);
                                sp [0].data.p = unboxed;
@@ -2755,20 +2755,20 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        
                        token = * (unsigned short *)(ip + 1);
                        ip += 2;
-                       child_frame.runtime_method = rtm->data_items [token];
+                       child_frame.imethod = rtm->data_items [token];
                        sp->data.p = vt_sp;
                        child_frame.retval = sp;
 
                        /* decrement by the actual number of args */
-                       sp -= child_frame.runtime_method->param_count + 1;
+                       sp -= child_frame.imethod->param_count + 1;
                        child_frame.stack_args = sp;
                        this_arg = sp->data.p;
                        if (!this_arg)
                                THROW_EX (mono_get_exception_null_reference(), ip - 2);
-                       child_frame.runtime_method = get_virtual_method (child_frame.runtime_method, this_arg);
+                       child_frame.imethod = get_virtual_method (child_frame.imethod, this_arg);
 
                        MonoClass *this_class = this_arg->vtable->klass;
-                       if (this_class->valuetype && child_frame.runtime_method->method->klass->valuetype) {
+                       if (this_class->valuetype && child_frame.imethod->method->klass->valuetype) {
                                gpointer *unboxed = mono_object_unbox (this_arg);
                                sp [0].data.p = unboxed;
                        }
@@ -2798,7 +2798,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_CALLRUN)
-                       ves_runtime_method (frame, context);
+                       ves_imethod (frame, context);
                        if (frame->ex) {
                                rtm = NULL;
                                goto handle_exception;
@@ -2812,7 +2812,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        goto exit_frame;
                MINT_IN_CASE(MINT_RET_VOID)
                        if (sp > frame->stack)
-                               g_warning ("ret.void: more values on stack: %d %s", sp-frame->stack, mono_method_full_name (frame->runtime_method->method, TRUE));
+                               g_warning ("ret.void: more values on stack: %d %s", sp-frame->stack, mono_method_full_name (frame->imethod->method, TRUE));
                        goto exit_frame;
                MINT_IN_CASE(MINT_RET_VT)
                        i32 = READ32(ip + 1);
@@ -3524,9 +3524,9 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context, uns
                        child_frame.ip = NULL;
                        child_frame.ex = NULL;
 
-                       child_frame.runtime_method = rtm->data_items [token];
-                       csig = mono_method_signature (child_frame.runtime_method->method);
-                       newobj_class = child_frame.runtime_method->method->klass;
+                       child_frame.imethod = rtm->data_items [token];
+                       csig = mono_method_signature (child_frame.imethod->method);
+                       newobj_class = child_frame.imethod->method->klass;
                        /*if (profiling_classes) {
                                guint count = GPOINTER_TO_UINT (g_hash_table_lookup (profiling_classes, newobj_class));
                                count++;
@@ -4490,8 +4490,8 @@ array_constructed:
                MINT_IN_CASE(MINT_MONO_RETOBJ)
                        ++ip;
                        sp--;
-                       stackval_from_data (mono_method_signature (frame->runtime_method->method)->ret, frame->retval, sp->data.p,
-                            mono_method_signature (frame->runtime_method->method)->pinvoke);
+                       stackval_from_data (mono_method_signature (frame->imethod->method)->ret, frame->retval, sp->data.p,
+                            mono_method_signature (frame->imethod->method)->pinvoke);
                        if (sp > frame->stack)
                                g_warning ("retobj: more values on stack: %d", sp-frame->stack);
                        goto exit_frame;
@@ -4678,7 +4678,7 @@ array_constructed:
                        MINT_IN_BREAK;
                }
                MINT_IN_CASE(MINT_LDVIRTFTN) {
-                       RuntimeMethod *m = rtm->data_items [* (guint16 *)(ip + 1)];
+                       InterpMethod *m = rtm->data_items [* (guint16 *)(ip + 1)];
                        ip += 2;
                        --sp;
                        if (!sp->data.p)
@@ -4838,7 +4838,7 @@ array_constructed:
 
                        int len = sp [-1].data.i;
                        sp [-1].data.p = alloca (len);
-                       MonoMethodHeader *header = mono_method_get_header_checked (frame->runtime_method->method, &error);
+                       MonoMethodHeader *header = mono_method_get_header_checked (frame->imethod->method, &error);
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        if (header && header->init_locals)
                                memset (sp [-1].data.p, 0, len);
@@ -4918,7 +4918,7 @@ array_constructed:
        {
                int i;
                guint32 ip_offset;
-               MonoInvocation *inv;
+               InterpFrame *inv;
                MonoExceptionClause *clause;
                /*char *message;*/
                MonoObject *ex_obj;
@@ -4934,19 +4934,19 @@ array_constructed:
 
                for (inv = frame; inv; inv = inv->parent) {
                        MonoMethod *method;
-                       if (inv->runtime_method == NULL)
+                       if (inv->imethod == NULL)
                                continue;
-                       method = inv->runtime_method->method;
+                       method = inv->imethod->method;
                        if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)
                                continue;
                        if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME))
                                continue;
                        if (inv->ip == NULL)
                                continue;
-                       ip_offset = inv->ip - inv->runtime_method->code;
+                       ip_offset = inv->ip - inv->imethod->code;
                        inv->ex_handler = NULL; /* clear this in case we are trhowing an exception while handling one  - this one wins */
-                       for (i = 0; i < inv->runtime_method->num_clauses; ++i) {
-                               clause = &inv->runtime_method->clauses [i];
+                       for (i = 0; i < inv->imethod->num_clauses; ++i) {
+                               clause = &inv->imethod->clauses [i];
 #if DEBUG_INTERP
                                g_print ("* clause [%d]: %p\n", i, clause);
 #endif
@@ -4958,18 +4958,18 @@ array_constructed:
                                        if (tracing)
                                                g_print ("* Filter found at '%s'\n", method->name);
 #endif
-                                       MonoInvocation dup_frame;
+                                       InterpFrame dup_frame;
                                        stackval retval;
-                                       memcpy (&dup_frame, inv, sizeof (MonoInvocation));
+                                       memcpy (&dup_frame, inv, sizeof (InterpFrame));
                                        dup_frame.retval = &retval;
-                                       ves_exec_method_with_context (&dup_frame, context, inv->runtime_method->code + clause->data.filter_offset, frame->ex, -1);
+                                       ves_exec_method_with_context (&dup_frame, context, inv->imethod->code + clause->data.filter_offset, frame->ex, -1);
                                        if (dup_frame.retval->data.i) {
 #if DEBUG_INTERP
                                                if (tracing)
                                                        g_print ("* Matched Filter at '%s'\n", method->name);
 #endif
                                                inv->ex_handler = clause;
-                                               *(MonoException**)(inv->locals + inv->runtime_method->exvar_offsets [i]) = frame->ex;
+                                               *(MonoException**)(inv->locals + inv->imethod->exvar_offsets [i]) = frame->ex;
                                                goto handle_finally;
                                        }
                                } else if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE) {
@@ -4985,7 +4985,7 @@ array_constructed:
                                                        g_print ("* Found handler at '%s'\n", method->name);
 #endif
                                                inv->ex_handler = clause;
-                                               *(MonoException**)(inv->locals + inv->runtime_method->exvar_offsets [i]) = frame->ex;
+                                               *(MonoException**)(inv->locals + inv->imethod->exvar_offsets [i]) = frame->ex;
                                                goto handle_finally;
                                        }
                                }
@@ -5011,7 +5011,7 @@ die_on_ex:
                guint32 ip_offset;
                MonoExceptionClause *clause;
                GSList *old_list = finally_ips;
-               MonoMethod *method = frame->runtime_method->method;
+               MonoMethod *method = frame->imethod->method;
                MonoMethodHeader *header = mono_method_get_header_checked (method, &error);
                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                
@@ -5068,7 +5068,7 @@ die_on_ex:
                guint32 ip_offset;
                MonoExceptionClause *clause;
                GSList *old_list = finally_ips;
-               MonoMethod *method = frame->runtime_method->method;
+               MonoMethod *method = frame->imethod->method;
                MonoMethodHeader *header = mono_method_get_header_checked (method, &error);
                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                
@@ -5124,11 +5124,11 @@ exit_frame:
 }
 
 void
-ves_exec_method (MonoInvocation *frame)
+ves_exec_method (InterpFrame *frame)
 {
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
        ThreadContext context_struct;
-       MonoDomain *domain = frame->runtime_method->domain;
+       MonoDomain *domain = frame->imethod->domain;
        MonoError error;
        jmp_buf env;
 
@@ -5150,7 +5150,7 @@ ves_exec_method (MonoInvocation *frame)
        }
        frame->ip = NULL;
        frame->parent = context->current_frame;
-       frame->runtime_method = mono_interp_get_runtime_method (domain, frame->method, &error);
+       frame->imethod = mono_interp_get_imethod (domain, frame->method, &error);
        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
        context->managed_code = 1;
        ves_exec_method_with_context (frame, context, NULL, NULL, -1);
@@ -5387,14 +5387,14 @@ mono_interp_set_resume_state (MonoJitTlsData *jit_tls, MonoException *ex, MonoIn
 void
 mono_interp_run_finally (StackFrameInfo *frame, int clause_index, gpointer handler_ip)
 {
-       MonoInvocation *iframe = frame->interp_frame;
+       InterpFrame *iframe = frame->interp_frame;
        ThreadContext *context = mono_native_tls_get_value (thread_context_id);
 
        ves_exec_method_with_context (iframe, context, handler_ip, NULL, clause_index);
 }
 
 typedef struct {
-       MonoInvocation *current;
+       InterpFrame *current;
 } StackIter;
 
 /*
@@ -5407,18 +5407,18 @@ mono_interp_frame_iter_init (MonoInterpStackIter *iter, gpointer interp_exit_dat
 {
        StackIter *stack_iter = (StackIter*)iter;
 
-       stack_iter->current = (MonoInvocation*)interp_exit_data;
+       stack_iter->current = (InterpFrame*)interp_exit_data;
 }
 
 gboolean
 mono_interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame)
 {
        StackIter *stack_iter = (StackIter*)iter;
-       MonoInvocation *iframe = stack_iter->current;
+       InterpFrame *iframe = stack_iter->current;
 
        memset (frame, 0, sizeof (StackFrameInfo));
-       /* pinvoke frames doesn't have runtime_method set */
-       while (iframe && !(iframe->runtime_method && iframe->runtime_method->code))
+       /* pinvoke frames doesn't have imethod set */
+       while (iframe && !(iframe->imethod && iframe->imethod->code))
                iframe = iframe->parent;
        if (!iframe)
                return FALSE;
@@ -5427,11 +5427,11 @@ mono_interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame)
        // FIXME:
        frame->domain = mono_domain_get ();
        frame->interp_frame = iframe;
-       frame->method = iframe->runtime_method->method;
+       frame->method = iframe->imethod->method;
        frame->actual_method = frame->method;
        /* This is the offset in the interpreter IR */
-       frame->native_offset = (guint8*)iframe->ip - (guint8*)iframe->runtime_method->code;
-       frame->ji = iframe->runtime_method->jinfo;
+       frame->native_offset = (guint8*)iframe->ip - (guint8*)iframe->imethod->code;
+       frame->ji = iframe->imethod->jinfo;
 
        stack_iter->current = iframe->parent;
 
@@ -5441,9 +5441,9 @@ mono_interp_frame_iter_next (MonoInterpStackIter *iter, StackFrameInfo *frame)
 MonoJitInfo*
 mono_interp_find_jit_info (MonoDomain *domain, MonoMethod *method)
 {
-       RuntimeMethod* rtm;
+       InterpMethod* rtm;
 
-       rtm = lookup_runtime_method (domain, method);
+       rtm = lookup_imethod (domain, method);
        if (rtm)
                return rtm->jinfo;
        else
@@ -5469,29 +5469,29 @@ mono_interp_clear_breakpoint (MonoJitInfo *jinfo, gpointer ip)
 MonoJitInfo*
 mono_interp_frame_get_jit_info (MonoInterpFrameHandle frame)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
-       return iframe->runtime_method->jinfo;
+       g_assert (iframe->imethod);
+       return iframe->imethod->jinfo;
 }
 
 gpointer
 mono_interp_frame_get_ip (MonoInterpFrameHandle frame)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
+       g_assert (iframe->imethod);
        return (gpointer)iframe->ip;
 }
 
 gpointer
 mono_interp_frame_get_arg (MonoInterpFrameHandle frame, int pos)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
+       g_assert (iframe->imethod);
 
-       int arg_offset = iframe->runtime_method->arg_offsets [pos + (iframe->runtime_method->hasthis ? 1 : 0)];
+       int arg_offset = iframe->imethod->arg_offsets [pos + (iframe->imethod->hasthis ? 1 : 0)];
 
        return iframe->args + arg_offset;
 }
@@ -5499,22 +5499,22 @@ mono_interp_frame_get_arg (MonoInterpFrameHandle frame, int pos)
 gpointer
 mono_interp_frame_get_local (MonoInterpFrameHandle frame, int pos)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
+       g_assert (iframe->imethod);
 
-       return iframe->locals + iframe->runtime_method->local_offsets [pos];
+       return iframe->locals + iframe->imethod->local_offsets [pos];
 }
 
 gpointer
 mono_interp_frame_get_this (MonoInterpFrameHandle frame)
 {
-       MonoInvocation *iframe = (MonoInvocation*)frame;
+       InterpFrame *iframe = (InterpFrame*)frame;
 
-       g_assert (iframe->runtime_method);
-       g_assert (iframe->runtime_method->hasthis);
+       g_assert (iframe->imethod);
+       g_assert (iframe->imethod->hasthis);
 
-       int arg_offset = iframe->runtime_method->arg_offsets [0];
+       int arg_offset = iframe->imethod->arg_offsets [0];
 
        return iframe->args + arg_offset;
 }
index 02a92f271c83a99ee29e82aac9cd2be02629a25f..ae2d41be153d659c7914ae8e7d890d49ed0ae033 100644 (file)
@@ -64,7 +64,7 @@ typedef struct
 {
        MonoMethod *method;
        MonoMethodHeader *header;
-       RuntimeMethod *rtm;
+       InterpMethod *rtm;
        const unsigned char *il_code;
        const unsigned char *ip;
        const unsigned char *last_ip;
@@ -948,7 +948,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
                }
        } else if (!calli && !virtual && jit_call_supported (target_method, csignature)) {
                ADD_CODE(td, MINT_JIT_CALL);
-               ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_runtime_method (domain, target_method, &error)));
+               ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_imethod (domain, target_method, &error)));
                mono_error_assert_ok (&error);
        } else {
                if (calli)
@@ -961,7 +961,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
                if (calli) {
                        ADD_CODE(td, get_data_item_index (td, (void *)csignature));
                } else {
-                       ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_runtime_method (domain, target_method, &error)));
+                       ADD_CODE(td, get_data_item_index (td, (void *)mono_interp_get_imethod (domain, target_method, &error)));
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                }
        }
@@ -1094,7 +1094,7 @@ get_basic_blocks (TransformData *td)
 }
 
 static void
-interp_save_debug_info (RuntimeMethod *rtm, MonoMethodHeader *header, TransformData *td, GArray *line_numbers)
+interp_save_debug_info (InterpMethod *rtm, MonoMethodHeader *header, TransformData *td, GArray *line_numbers)
 {
        MonoDebugMethodJitInfo *dinfo;
        int i;
@@ -1224,7 +1224,7 @@ collect_pred_seq_points (TransformData *td, InterpBasicBlock *bb, SeqPoint *seqp
 static void
 save_seq_points (TransformData *td)
 {
-       RuntimeMethod *rtm = td->rtm;
+       InterpMethod *rtm = td->rtm;
        GByteArray *array;
        int i, seq_info_size;
        MonoSeqPointInfo *info;
@@ -1338,7 +1338,7 @@ emit_seq_point (TransformData *td, int il_offset, InterpBasicBlock *cbb, gboolea
        } while (0)
 
 static void
-generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, MonoGenericContext *generic_context)
+generate (MonoMethod *method, InterpMethod *rtm, unsigned char *is_bb_start, MonoGenericContext *generic_context)
 {
        MonoMethodHeader *header = mono_method_get_header (method);
        MonoMethodSignature *signature = mono_method_signature (method);
@@ -1750,7 +1750,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        token = read32 (td.ip + 1);
                        m = mono_get_method_full (image, token, NULL, generic_context);
                        ADD_CODE (&td, MINT_JMP);
-                       ADD_CODE (&td, get_data_item_index (&td, mono_interp_get_runtime_method (domain, m, &error)));
+                       ADD_CODE (&td, get_data_item_index (&td, mono_interp_get_imethod (domain, m, &error)));
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        td.ip += 5;
                        break;
@@ -2453,7 +2453,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                        klass = m->klass;
                        td.sp -= csignature->param_count;
                        ADD_CODE(&td, MINT_NEWOBJ);
-                       ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (domain, m, &error)));
+                       ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_imethod (domain, m, &error)));
                        mono_error_cleanup (&error); /* FIXME: don't swallow the error */
 
                        if (mint_type (&klass->byval_arg) == MINT_TYPE_VT) {
@@ -3682,7 +3682,7 @@ generate (MonoMethod *method, RuntimeMethod *rtm, unsigned char *is_bb_start, Mo
                                        m = mono_marshal_get_synchronized_wrapper (m);
 
                                ADD_CODE(&td, *td.ip == CEE_LDFTN ? MINT_LDFTN : MINT_LDVIRTFTN);
-                               ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_runtime_method (domain, m, &error)));
+                               ADD_CODE(&td, get_data_item_index (&td, mono_interp_get_imethod (domain, m, &error)));
                                mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                                td.ip += 5;
                                PUSH_SIMPLE_TYPE (&td, STACK_TYPE_F);
@@ -3968,10 +3968,10 @@ mono_interp_transform_init (void)
 }
 
 MonoException *
-mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *context)
+mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context)
 {
        int i, align, size, offset;
-       MonoMethod *method = runtime_method->method;
+       MonoMethod *method = imethod->method;
        MonoImage *image = method->klass->image;
        MonoMethodHeader *header = mono_method_get_header (method);
        MonoMethodSignature *signature = mono_method_signature (method);
@@ -3984,14 +3984,14 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
        MonoVTable *method_class_vt;
        int backwards;
        MonoGenericContext *generic_context = NULL;
-       MonoDomain *domain = runtime_method->domain;
+       MonoDomain *domain = imethod->domain;
 
        // g_printerr ("TRANSFORM(0x%016lx): begin %s::%s\n", mono_thread_current (), method->klass->name, method->name);
-       method_class_vt = mono_class_vtable (domain, runtime_method->method->klass);
+       method_class_vt = mono_class_vtable (domain, imethod->method->klass);
        if (!method_class_vt->initialized) {
                MonoError error;
                jmp_buf env;
-               MonoInvocation *last_env_frame = context->env_frame;
+               InterpFrame *last_env_frame = context->env_frame;
                jmp_buf *old_env = context->current_env;
                error_init (&error);
 
@@ -4025,9 +4025,9 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
        if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) {
                MonoMethod *nm = NULL;
                mono_os_mutex_lock(&calc_section);
-               if (runtime_method->transformed) {
+               if (imethod->transformed) {
                        mono_os_mutex_unlock(&calc_section);
-                       MONO_PROFILER_RAISE (jit_done, (method, runtime_method->jinfo));
+                       MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
                        return NULL;
                }
 
@@ -4052,14 +4052,14 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                                }
                        }
                        if (nm == NULL) {
-                               runtime_method->code = g_malloc(sizeof(short));
-                               runtime_method->code[0] = MINT_CALLRUN;
+                               imethod->code = g_malloc(sizeof(short));
+                               imethod->code[0] = MINT_CALLRUN;
                        }
                }
                if (nm == NULL) {
-                       runtime_method->stack_size = sizeof (stackval); /* for tracing */
-                       runtime_method->alloca_size = runtime_method->stack_size;
-                       runtime_method->transformed = TRUE;
+                       imethod->stack_size = sizeof (stackval); /* for tracing */
+                       imethod->alloca_size = imethod->stack_size;
+                       imethod->transformed = TRUE;
                        mono_os_mutex_unlock(&calc_section);
                        MONO_PROFILER_RAISE (jit_done, (method, NULL));
                        return NULL;
@@ -4070,12 +4070,12 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
        } else if (method->klass == mono_defaults.array_class) {
                if (!strcmp (method->name, "UnsafeMov") || !strcmp (method->name, "UnsafeLoad")) {
                        mono_os_mutex_lock (&calc_section);
-                       if (!runtime_method->transformed) {
-                               runtime_method->code = g_malloc (sizeof (short));
-                               runtime_method->code[0] = MINT_CALLRUN;
-                               runtime_method->stack_size = sizeof (stackval); /* for tracing */
-                               runtime_method->alloca_size = runtime_method->stack_size;
-                               runtime_method->transformed = TRUE;
+                       if (!imethod->transformed) {
+                               imethod->code = g_malloc (sizeof (short));
+                               imethod->code[0] = MINT_CALLRUN;
+                               imethod->stack_size = sizeof (stackval); /* for tracing */
+                               imethod->alloca_size = imethod->stack_size;
+                               imethod->transformed = TRUE;
                        }
                        mono_os_mutex_unlock(&calc_section);
                        MONO_PROFILER_RAISE (jit_done, (method, NULL));
@@ -4199,44 +4199,44 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
 
        /* the rest needs to be locked so it is only done once */
        mono_os_mutex_lock(&calc_section);
-       if (runtime_method->transformed) {
+       if (imethod->transformed) {
                mono_os_mutex_unlock(&calc_section);
                g_free (is_bb_start);
-               MONO_PROFILER_RAISE (jit_done, (method, runtime_method->jinfo));
+               MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
                return NULL;
        }
 
-       runtime_method->local_offsets = g_malloc (header->num_locals * sizeof(guint32));
-       runtime_method->stack_size = (sizeof (stackval)) * (header->max_stack + 2); /* + 1 for returns of called functions  + 1 for 0-ing in trace*/
-       runtime_method->stack_size = (runtime_method->stack_size + 7) & ~7;
+       imethod->local_offsets = g_malloc (header->num_locals * sizeof(guint32));
+       imethod->stack_size = (sizeof (stackval)) * (header->max_stack + 2); /* + 1 for returns of called functions  + 1 for 0-ing in trace*/
+       imethod->stack_size = (imethod->stack_size + 7) & ~7;
        offset = 0;
        for (i = 0; i < header->num_locals; ++i) {
                size = mono_type_size (header->locals [i], &align);
                offset += align - 1;
                offset &= ~(align - 1);
-               runtime_method->local_offsets [i] = offset;
+               imethod->local_offsets [i] = offset;
                offset += size;
        }
        offset = (offset + 7) & ~7;
 
-       runtime_method->exvar_offsets = g_malloc (header->num_clauses * sizeof (guint32));
+       imethod->exvar_offsets = g_malloc (header->num_clauses * sizeof (guint32));
        for (i = 0; i < header->num_clauses; i++) {
                offset += sizeof (MonoObject*);
-               runtime_method->exvar_offsets [i] = offset;
+               imethod->exvar_offsets [i] = offset;
        }
        offset = (offset + 7) & ~7;
 
-       runtime_method->locals_size = offset;
-       g_assert (runtime_method->locals_size < 65536);
+       imethod->locals_size = offset;
+       g_assert (imethod->locals_size < 65536);
        offset = 0;
-       runtime_method->arg_offsets = g_malloc ((!!signature->hasthis + signature->param_count) * sizeof(guint32));
+       imethod->arg_offsets = g_malloc ((!!signature->hasthis + signature->param_count) * sizeof(guint32));
 
        if (signature->hasthis) {
                g_assert (!signature->pinvoke);
                size = mono_type_stack_size (&method->klass->byval_arg, &align);
                offset += align - 1;
                offset &= ~(align - 1);
-               runtime_method->arg_offsets [0] = offset;
+               imethod->arg_offsets [0] = offset;
                offset += size;
        }
 
@@ -4250,20 +4250,20 @@ mono_interp_transform_method (RuntimeMethod *runtime_method, ThreadContext *cont
                        size = mono_type_stack_size (signature->params [i], &align);
                offset += align - 1;
                offset &= ~(align - 1);
-               runtime_method->arg_offsets [i + !!signature->hasthis] = offset;
+               imethod->arg_offsets [i + !!signature->hasthis] = offset;
                offset += size;
        }
        offset = (offset + 7) & ~7;
-       runtime_method->args_size = offset;
-       g_assert (runtime_method->args_size < 10000);
+       imethod->args_size = offset;
+       g_assert (imethod->args_size < 10000);
 
-       generate (method, runtime_method, is_bb_start, generic_context);
+       generate (method, imethod, is_bb_start, generic_context);
 
        g_free (is_bb_start);
 
        // FIXME: Add a different callback ?
-       MONO_PROFILER_RAISE (jit_done, (method, runtime_method->jinfo));
-       runtime_method->transformed = TRUE;
+       MONO_PROFILER_RAISE (jit_done, (method, imethod->jinfo));
+       imethod->transformed = TRUE;
        mono_os_mutex_unlock(&calc_section);
 
        return NULL;