[runtime] Use slow path managed allocators when profiling a FullAOT image.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 14 May 2015 12:46:49 +0000 (14:46 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Fri, 15 May 2015 18:05:01 +0000 (20:05 +0200)
commita83f965db02244e83a93ee186a13b1461adeafa5
treeac87456c4aadbb868077c0079cb96bf877560c23
parent7cb2c544b441edfd92b290c982aa88dd33044c5b
[runtime] Use slow path managed allocators when profiling a FullAOT image.

This is needed because the fast paths in managed allocators (by design) don't
report allocations to the profiler. In regular JIT/AOT mode, managed allocators
are simply disabled to work around this when profiling. However, in FullAOT
mode, an image may have been compiled with managed allocators enabled which
results in the managed allocator actually being emitted into the AOT image.

So, when we want to profile a FullAOT image, we need to replace the regular
managed allocator with one that always goes through the slow path (i.e. calls
straight into the runtime). To that end, when we decode a MONO_WRAPPER_ALLOC
method ref, we redirect it to the appropriate slow path allocator if allocation
profiling is enabled.
mono/metadata/boehm-gc.c
mono/metadata/gc-internal.h
mono/metadata/null-gc.c
mono/metadata/sgen-mono.c
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c