[llvmonly] Remove some jit icalls which are no longer used.
authorZoltan Varga <vargaz@gmail.com>
Mon, 4 Jan 2016 19:08:06 +0000 (14:08 -0500)
committerZoltan Varga <vargaz@gmail.com>
Mon, 4 Jan 2016 19:08:06 +0000 (14:08 -0500)
mono/mini/aot-compiler.c
mono/mini/jit-icalls.c
mono/mini/jit-icalls.h
mono/mini/method-to-ir.c
mono/mini/mini-runtime.c

index c073ec22cb5edac40f9d8b406fd90a67b88ca4a8..1f40bb01de76dc42ce43ce11f7177ad42cfd6aa3 100644 (file)
@@ -9620,7 +9620,6 @@ static const char *preinited_jit_icalls[] = {
        "mono_aot_init_gshared_method_this",
        "mono_aot_init_gshared_method_rgctx",
        "mono_llvm_throw_corlib_exception",
-       "mono_resolve_vcall",
        "mono_init_vtable_slot",
        "mono_helper_ldstr_mscorlib"
 };
index 1979867d513527695cd57a6275c7ff70be634160..9ec439f8171ed8800179a8edb0d91ccff0bdc9d3 100644 (file)
@@ -1331,6 +1331,7 @@ mono_fill_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, int index)
  * resolve_iface_call:
  *
  *   Return the executable code for the iface method IMT_METHOD called on THIS.
+ * This function is called on a slowpath, so it doesn't need to be fast.
  */
 static gpointer
 resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg, gboolean caller_gsharedvt)
@@ -1341,8 +1342,6 @@ resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method,
        gpointer addr, compiled_method, aot_addr;
        gboolean need_rgctx_tramp = FALSE, need_unbox_tramp = FALSE;
 
-       // FIXME: Optimize this
-
        if (!this_obj)
                /* The caller will handle it */
                return NULL;
@@ -1380,12 +1379,6 @@ resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method,
        return addr;
 }
 
-gpointer
-mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg)
-{
-       return resolve_iface_call (this_obj, imt_slot, imt_method, out_arg, FALSE);
-}
-
 gpointer
 mono_resolve_iface_call_gsharedvt (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg)
 {
@@ -1413,6 +1406,7 @@ is_generic_method_definition (MonoMethod *m)
  * resolve_vcall:
  *
  *   Return the executable code for calling vt->vtable [slot].
+ * This function is called on a slowpath, so it doesn't need to be fast.
  */
 static gpointer
 resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_arg, gboolean gsharedvt)
@@ -1421,8 +1415,6 @@ resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_a
        gpointer addr, compiled_method;
        gboolean need_unbox_tramp = FALSE;
 
-       // FIXME: Optimize this
-
        /* Same as in common_call_trampoline () */
 
        /* Avoid loading metadata or creating a generic vtable if possible */
@@ -1470,8 +1462,6 @@ resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_a
 
        addr = mini_add_method_wrappers_llvmonly (m, addr, FALSE, need_unbox_tramp, out_arg);
 
-       // FIXME: Unify this with mono_resolve_iface_call
-
        if (gsharedvt) {
                /*
                 * The callee uses the gsharedvt calling convention, have to add an out wrapper.
@@ -1500,14 +1490,6 @@ resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_a
        return addr;
 }
 
-gpointer
-mono_resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_rgctx_arg)
-{
-       g_assert (this_obj);
-
-       return resolve_vcall (this_obj->vtable, slot, imt_method, out_rgctx_arg, FALSE);
-}
-
 gpointer
 mono_resolve_vcall_gsharedvt (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_rgctx_arg)
 {
index 7a5a885dd64d93602a8905711d6eeded5a834055..78ee8272db6be49533dbccc89b72f385b892e851 100644 (file)
@@ -195,10 +195,6 @@ gpointer mono_fill_class_rgctx (MonoVTable *vtable, int index);
 
 gpointer mono_fill_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, int index);
 
-gpointer mono_resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg);
-
-gpointer mono_resolve_vcall (MonoObject *this_obj, int slot, MonoMethod *imt_method, gpointer *out_arg);
-
 gpointer mono_resolve_iface_call_gsharedvt (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg);
 
 gpointer mono_resolve_vcall_gsharedvt (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method, gpointer *out_arg);
index 001aec0b68348e8021277d808477095131d406f3..3dfb4ec87ac61358419ce0eb2f41ffc02f7a4e12 100644 (file)
@@ -7785,23 +7785,15 @@ emit_llvmonly_virtual_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSig
        icall_args [2] = emit_get_rgctx_method (cfg, context_used,
                                                                                        cmethod, MONO_RGCTX_INFO_METHOD);
 
-       // FIXME: For generic virtual calls, avoid computing the rgctx twice
-
        arg_reg = alloc_preg (cfg);
        MONO_EMIT_NEW_PCONST (cfg, arg_reg, NULL);
        EMIT_NEW_VARLOADA_VREG (cfg, icall_args [3], arg_reg, &mono_defaults.int_class->byval_arg);
 
-       if (is_gsharedvt) {
-               if (is_iface)
-                       call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call_gsharedvt, icall_args);
-               else
-                       call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall_gsharedvt, icall_args);
-       } else {
-               if (is_iface)
-                       call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call, icall_args);
-               else
-                       call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall, icall_args);
-       }
+       g_assert (is_gsharedvt);
+       if (is_iface)
+               call_target = mono_emit_jit_icall (cfg, mono_resolve_iface_call_gsharedvt, icall_args);
+       else
+               call_target = mono_emit_jit_icall (cfg, mono_resolve_vcall_gsharedvt, icall_args);
 
        /*
         * Pass the extra argument even if the callee doesn't receive it, most
index f33a3e8c308310ef0492e40aa4d1ee360e6b4850..3c1b0cf37e5aa1d5b452e0e91343e953efdbc545 100644 (file)
@@ -3808,8 +3808,6 @@ register_icalls (void)
        register_icall (mono_aot_init_gshared_method_this, "mono_aot_init_gshared_method_this", "void ptr int object", TRUE);
        register_icall (mono_aot_init_gshared_method_rgctx, "mono_aot_init_gshared_method_rgctx", "void ptr int ptr", TRUE);
 
-       register_icall_no_wrapper (mono_resolve_iface_call, "mono_resolve_iface_call", "ptr object int ptr ptr");
-       register_icall_no_wrapper (mono_resolve_vcall, "mono_resolve_vcall", "ptr object int ptr ptr");
        register_icall_no_wrapper (mono_resolve_iface_call_gsharedvt, "mono_resolve_iface_call_gsharedvt", "ptr object int ptr ptr");
        register_icall_no_wrapper (mono_resolve_vcall_gsharedvt, "mono_resolve_vcall_gsharedvt", "ptr object int ptr ptr");
        register_icall_no_wrapper (mono_resolve_generic_virtual_call, "mono_resolve_generic_virtual_call", "ptr ptr int ptr");