Emit profiler enter/leave instrumentation calls as icalls.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Wed, 23 Apr 2014 16:20:08 +0000 (18:20 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Mon, 28 Apr 2014 14:52:58 +0000 (16:52 +0200)
commit7b48e454d7352466aa2b86dcf4a0025ef66e5425
treec12fe2a7a2d816d5f815a37e7e877d97cf020f6f
parent038456fe38738478289759bbe28eb98d64543381
Emit profiler enter/leave instrumentation calls as icalls.

This is more portable than using the mono_arch_instrument_* functions and
thus isn't prone to nasty arch-specific bugs. In particular, the old way
of instrumenting function prologues/epilogues resulted in a somewhat elusive
stack corruption bug on Android (ARM). Eventually, we should get rid of these
functions entirely and only use icalls, with JIT opcodes for special cases
(such as saving arguments for --trace).

This new way of doing things also makes profiler instrumentation AOT-safe,
since we're now going through the proper channels to emit references to the
runtime functions (mono_profiler_method_enter/leave) and to embed MonoMethod
pointers.

Since we're using icalls without wrappers to do this, there should be no
visible performance impact from this commit.
mono/mini/method-to-ir.c
mono/mini/mini-amd64.c
mono/mini/mini-x86.c
mono/mini/mini.c