[llvmonly] Remove the old llvmonly runtime support code, its not needed anymore.
authorZoltan Varga <vargaz@gmail.com>
Thu, 7 Jan 2016 17:39:53 +0000 (12:39 -0500)
committerZoltan Varga <vargaz@gmail.com>
Thu, 7 Jan 2016 17:39:59 +0000 (12:39 -0500)
mono/metadata/gc.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/object.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/mini-runtime.c

index e0f12d34b558cf3ad62cc353a2e91618c6377062..901a985a587039274d535a496d934e75c58df240 100644 (file)
@@ -236,7 +236,7 @@ mono_gc_run_finalize (void *obj, void *data)
                g_log ("mono-gc-finalizers", G_LOG_LEVEL_MESSAGE, "<%s at %p> Compiling finalizer.", o->vtable->klass->name, o);
 
        if (!domain->finalize_runtime_invoke) {
-               MonoMethod *invoke = mono_marshal_get_runtime_invoke (mono_class_get_method_from_name_flags (mono_defaults.object_class, "Finalize", 0, 0), TRUE, FALSE);
+               MonoMethod *invoke = mono_marshal_get_runtime_invoke (mono_class_get_method_from_name_flags (mono_defaults.object_class, "Finalize", 0, 0), TRUE);
 
                domain->finalize_runtime_invoke = mono_compile_method (invoke);
        }
index 8fcc61e3691c76a7858a9d6510c7521ec8d6380b..afee5aa710c4adc14eb04f3910390358f8a6598f 100644 (file)
@@ -3872,11 +3872,9 @@ emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoImage *image, MonoMethod *m
  * it means that the compiled code for METHOD does not have to be looked up 
  * before calling the runtime invoke wrapper. In this case, the wrapper ignores
  * its METHOD argument.
- * If PASS_RGCTX is TRUE, the signature of the called method is changed to include a 'gpointer rgctx' as the
- * last argument (after 'this').
  */
 MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean pass_rgctx)
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_)
 {
        MonoMethodSignature *sig, *csig, *callsig;
        MonoMethodBuilder *mb;
@@ -3942,11 +3940,6 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean
 
        sig = mono_method_signature (method);
 
-       if (pass_rgctx) {
-               sig = sig_to_rgctx_sig (sig);
-               callsig = sig_to_rgctx_sig (callsig);
-       }
-
        target_klass = get_wrapper_target_class (method->klass->image);
 
        /* Try to share wrappers for non-corlib methods with simple signatures */
@@ -4006,7 +3999,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean
        csig->call_convention = MONO_CALL_C;
 #endif
 
-       name = mono_signature_to_name (callsig, pass_rgctx ? (virtual_ ? "runtime_invoke_virtual_rgctx" : "runtime_invoke_rgctx") : (virtual_ ? "runtime_invoke_virtual" : "runtime_invoke"));
+       name = mono_signature_to_name (callsig, virtual_ ? "runtime_invoke_virtual" : "runtime_invoke");
        mb = mono_mb_new (target_klass, name,  MONO_WRAPPER_RUNTIME_INVOKE);
        g_free (name);
 
@@ -4035,7 +4028,6 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean
 
                info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL);
                info->d.runtime_invoke.sig = callsig;
-               info->d.runtime_invoke.pass_rgctx = pass_rgctx;
 
                /* Somebody may have created it before us */
                if (!res) {
index 2814208700edd3190b040820e3c0474b05e50351..494ff3d435ef5dbdbc99385fa2f90eea8ee6f162 100644 (file)
@@ -142,7 +142,6 @@ typedef struct {
        MonoMethod *method;
        /* For WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL */
        MonoMethodSignature *sig;
-       gboolean pass_rgctx;
 } RuntimeInvokeWrapperInfo;
 
 typedef struct {
@@ -347,7 +346,7 @@ MonoMethod *
 mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method);
 
 MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual, gboolean pass_rgctx);
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual);
 
 MonoMethod*
 mono_marshal_get_runtime_invoke_dynamic (void);
index 5a5c31b3e6cbd92c911a54913dc676aa90aa0763..8ba5568aa9d40e02e914880e843f12cbf7c00ef6 100644 (file)
@@ -6035,7 +6035,7 @@ mono_runtime_capture_context (MonoDomain *domain)
                MonoMethod *wrapper;
                if (!method)
                        return NULL;
-               wrapper = mono_marshal_get_runtime_invoke (method, FALSE, FALSE);
+               wrapper = mono_marshal_get_runtime_invoke (method, FALSE);
                domain->capture_context_runtime_invoke = mono_compile_method (wrapper);
                domain->capture_context_method = mono_compile_method (method);
        }
index 44179fd1bdd33b0dbc3b735042a4b21634edd22b..076542a2ae84d8643b82f4dd744611f4ad2c1430 100644 (file)
@@ -2918,7 +2918,6 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8
                case MONO_WRAPPER_RUNTIME_INVOKE: {
                        g_assert (info);
                        encode_value (info->subtype, p, &p);
-                       encode_value (info->d.runtime_invoke.pass_rgctx, p, &p);
                        if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT || info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL)
                                encode_method_ref (acfg, info->d.runtime_invoke.method, p, &p);
                        else if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL)
@@ -3324,13 +3323,13 @@ get_runtime_invoke_sig (MonoMethodSignature *sig)
 
        mb = mono_mb_new (mono_defaults.object_class, "FOO", MONO_WRAPPER_NONE);
        m = mono_mb_create_method (mb, sig, 16);
-       return mono_marshal_get_runtime_invoke (m, FALSE, FALSE);
+       return mono_marshal_get_runtime_invoke (m, FALSE);
 }
 
 static MonoMethod*
 get_runtime_invoke (MonoAotCompile *acfg, MonoMethod *method, gboolean virtual_)
 {
-       return mono_marshal_get_runtime_invoke (method, virtual_, acfg->aot_opts.llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE));
+       return mono_marshal_get_runtime_invoke (method, virtual_);
 }
 
 static gboolean
index fd6b9172c78956b841b803a9d677d96cc899841c..a40be9bfbdebd56e7813a8b39148f0b7d146b31b 100644 (file)
@@ -1064,7 +1064,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                }
                case MONO_WRAPPER_RUNTIME_INVOKE: {
                        int subtype = decode_value (p, &p);
-                       int pass_rgctx = decode_value (p, &p);
 
                        if (!target)
                                return FALSE;
@@ -1079,14 +1078,14 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
 
                                if (!m)
                                        return FALSE;
-                               ref->method = mono_marshal_get_runtime_invoke (m, FALSE, pass_rgctx);
+                               ref->method = mono_marshal_get_runtime_invoke (m, FALSE);
                        } else if (subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL) {
                                /* Virtual direct wrapper */
                                MonoMethod *m = decode_resolve_method_ref (module, p, &p);
 
                                if (!m)
                                        return FALSE;
-                               ref->method = mono_marshal_get_runtime_invoke (m, TRUE, pass_rgctx);
+                               ref->method = mono_marshal_get_runtime_invoke (m, TRUE);
                        } else {
                                MonoMethodSignature *sig;
 
@@ -1096,8 +1095,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
 
                                if (info->subtype != subtype)
                                        return FALSE;
-                               if (info->d.runtime_invoke.pass_rgctx != pass_rgctx)
-                                       return FALSE;
                                g_assert (info->d.runtime_invoke.sig);
                                if (mono_metadata_signature_equal (sig, info->d.runtime_invoke.sig))
                                        ref->method = target;
index 91bc9018668a915c7243bc4e08e826015c7cb82a..d4526dd082abd8ec8f7e8156a233733494d9204f 100644 (file)
@@ -2151,7 +2151,6 @@ typedef struct {
        MonoVTable *vtable;
        MonoDynCallInfo *dyn_call_info;
        MonoClass *ret_box_class;
-       gboolean needs_rgctx;
        MonoMethodSignature *sig;
        gboolean gsharedvt_invoke;
        gpointer *wrapper_arg;
@@ -2162,6 +2161,7 @@ mini_gsharedvt_runtime_invoke_supported (MonoMethodSignature *sig)
 {
        gboolean supported = TRUE;
 
+       // FIXME:
        if (sig->ret->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (sig->ret)))
                supported = FALSE;
 
@@ -2175,10 +2175,9 @@ create_runtime_invoke_info (MonoDomain *domain, MonoMethod *method, gpointer com
        RuntimeInvokeInfo *info;
 
        info = g_new0 (RuntimeInvokeInfo, 1);
-       info->needs_rgctx = mono_llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE);
        info->compiled_method = compiled_method;
 
-       invoke = mono_marshal_get_runtime_invoke (method, FALSE, info->needs_rgctx);
+       invoke = mono_marshal_get_runtime_invoke (method, FALSE);
        info->vtable = mono_class_vtable_full (domain, method->klass, TRUE);
        g_assert (info->vtable);
 
@@ -2197,7 +2196,6 @@ create_runtime_invoke_info (MonoDomain *domain, MonoMethod *method, gpointer com
 
                if (method->string_ctor)
                        sig = mono_marshal_get_string_ctor_signature (method);
-               g_assert (!info->needs_rgctx);
 
                for (i = 0; i < sig->param_count; ++i) {
                        MonoType *t = sig->params [i];
@@ -2359,7 +2357,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                                MonoMethod *wrapper;
 
                                wrapper = mono_marshal_get_array_accessor_wrapper (method);
-                               invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE, FALSE);
+                               invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE);
                                callee = wrapper;
                        } else {
                                callee = NULL;
@@ -2427,7 +2425,6 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                int i, pindex;
                guint8 buf [512];
                guint8 retval [256];
-               gpointer rgctx;
 
                if (!dyn_runtime_invoke) {
                        invoke = mono_marshal_get_runtime_invoke_dynamic ();
@@ -2435,7 +2432,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                }
 
                /* Convert the arguments to the format expected by start_dyn_call () */
-               args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer));
+               args = (void **)g_alloca ((sig->param_count + sig->hasthis) * sizeof (gpointer));
                pindex = 0;
                if (sig->hasthis)
                        args [pindex ++] = &obj;
@@ -2450,10 +2447,6 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                                args [pindex ++] = params [i];
                        }
                }
-               if (info->needs_rgctx) {
-                       rgctx = mini_method_get_rgctx (method);
-                       args [pindex ++] = &rgctx;
-               }
 
                //printf ("M: %s\n", mono_method_full_name (method, TRUE));
 
@@ -2534,23 +2527,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                        return *(MonoObject**)retval;
        }
 
-       // FIXME: Cache this
-       if (info->needs_rgctx) {
-               MonoMethodSignature *sig = mono_method_signature (method);
-               gpointer rgctx;
-               gpointer *args;
-               int i, pindex;
-
-               args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer));
-               pindex = 0;
-               rgctx = mini_method_get_rgctx (method);
-               for (i = 0; i < sig->param_count; ++i)
-                       args [pindex ++] = params [i];
-               args [pindex ++] = &rgctx;
-               return runtime_invoke ((MonoObject *)obj, args, exc, info->compiled_method);
-       } else {
-               return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
-       }
+       return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
 }
 
 typedef struct {
@@ -4057,7 +4034,7 @@ mono_precompile_assembly (MonoAssembly *ass, void *user_data)
                }
                mono_compile_method (method);
                if (strcmp (method->name, "Finalize") == 0) {
-                       invoke = mono_marshal_get_runtime_invoke (method, FALSE, FALSE);
+                       invoke = mono_marshal_get_runtime_invoke (method, FALSE);
                        mono_compile_method (invoke);
                }
 #ifndef DISABLE_REMOTING