Merge pull request #5439 from alexrp/master
[mono.git] / mono / mini / method-to-ir.c
index 2c30d87a59f34b5949e339e963a638bf63fe324b..442ec3c0a5c9005eab5da957140d8c8851189215 100644 (file)
@@ -8845,6 +8845,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        }
                                        for (i = 0; i < n; ++i)
                                                EMIT_NEW_ARGSTORE (cfg, ins, i, sp [i]);
+
+                                       mini_profiler_emit_tail_call (cfg, cmethod);
+
                                        MONO_INST_NEW (cfg, ins, OP_BR);
                                        MONO_ADD_INS (cfg->cbb, ins);
                                        tblock = start_bblock->out_bb [0];
@@ -11779,6 +11782,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                if (sp != stack_start)
                                        UNVERIFIED;
                                
+                               mini_profiler_emit_leave (cfg, sp [0]);
+
                                MONO_INST_NEW (cfg, ins, OP_BR);
                                ins->inst_target_bb = end_bblock;
                                MONO_ADD_INS (cfg->cbb, ins);