Revert "[jit] Enable tail calls from gshared code. Fixes #25224."
authorZoltan Varga <vargaz@gmail.com>
Thu, 11 Dec 2014 22:51:19 +0000 (17:51 -0500)
committerZoltan Varga <vargaz@gmail.com>
Thu, 11 Dec 2014 22:51:19 +0000 (17:51 -0500)
This reverts commit ca0dd5c0bb0f600331aac3c6b8d0579e37cdd0c7.

Revert this as it causes a performance regression in f#.

mono/mini/method-to-ir.c
mono/mini/mini-trampolines.c

index 8b67e45842d78d0beb263bebfc4f9234c83a7732..3e1a3554c836e6ce99c720541fbf0abed7fcc2c5 100755 (executable)
@@ -8812,14 +8812,11 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        /* Tail prefix / tail call optimization */
 
                        /* FIXME: Enabling TAILC breaks some inlining/stack trace/etc tests */
-                       if (ARCH_HAVE_OP_TAIL_CALL) {
-                               if (cmethod && (ins_flag & MONO_INST_TAILCALL) && !cfg->gsharedvt && is_supported_tail_call (cfg, method, cmethod, fsig, call_opcode))
-                                       supported_tail_call = TRUE;
-                       } else {
-                               if (cmethod && (ins_flag & MONO_INST_TAILCALL) &&
+                       /* FIXME: runtime generic context pointer for jumps? */
+                       /* FIXME: handle this for generic sharing eventually */
+                       if (cmethod && (ins_flag & MONO_INST_TAILCALL) &&
                                !vtable_arg && !cfg->generic_sharing_context && is_supported_tail_call (cfg, method, cmethod, fsig, call_opcode))
-                                       supported_tail_call = TRUE;
-                       }
+                               supported_tail_call = TRUE;
 
                        if (supported_tail_call) {
                                MonoCallInst *call;
index c27ca61cbba8edad6d81b1286e4d18741255a6d3..fec24a3cb3818ba7237abfad9dedb1944cc8ca64 100644 (file)
@@ -495,9 +495,7 @@ common_call_trampoline (mgreg_t *regs, guint8 *code, MonoMethod *m, guint8* tram
                vtable_slot = NULL;
                generic_shared = TRUE;
 
-               if (!ARCH_HAVE_OP_TAIL_CALL)
-                       /* Tail calls can be made from gshared code */
-                       g_assert (code);
+               g_assert (code);
 
                if (m->is_inflated && mono_method_get_context (m)->method_inst) {
 #ifdef MONO_ARCH_RGCTX_REG