Inliner: support inlining of methods with pinned locals
authorAndy Ayers <andya@microsoft.com>
Sat, 22 Oct 2016 01:46:50 +0000 (18:46 -0700)
committerAndy Ayers <andya@microsoft.com>
Wed, 9 Nov 2016 23:12:44 +0000 (15:12 -0800)
commitc60e68e51a8a09886df5e085986dae76cd74f974
treeb186745ffea14eeb4603ffaa1f8e4ef29742d23a
parente76da565c106016d604b95f3bb7eadd24ceaf18a
Inliner: support inlining of methods with pinned locals

The inliner now can inline a subset of methods with pinned locals --
namely those where the language compiler (eg CSC) can determine that a
try/finally is not necessary to ensure unpinning, and where the jit
likewise an determines that a try/finally is likewise not needed in
the root method.

Generally speaking this allows inlining in cases where the inline method
is fairly simple and does not any contain exception handling, and the
call site is not within a try region.

When inlining methods that have pinned locals and also return a value,
the jit ensures that the return value is spilled to a temp so that the
unpins can be placed just after the inlined method body and won't alter
the return value.

Mark FixedAddressValueType as GCStressIncompatible since the "unfixed"
class static may get re-allocated at the same address. This seems to
happen even without these changes but happens much more frequently with
them.

Closes #7774.
src/jit/compiler.h
src/jit/flowgraph.cpp
src/jit/importer.cpp
src/jit/inline.def
src/jit/inline.h
src/jit/inlinepolicy.cpp
src/jit/inlinepolicy.h
tests/src/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.csproj