JIT: keep ref count for runtime generic context lookups
authorAndy Ayers <andya@microsoft.com>
Sat, 18 Feb 2017 04:51:59 +0000 (20:51 -0800)
committerAndy Ayers <andya@microsoft.com>
Fri, 24 Feb 2017 00:23:18 +0000 (16:23 -0800)
commitf8f8947d25212d679fa85a661d92cceabd665de3
treec09c636c002b89fae7bf3337feee08e6876af63b
parent43b2ce9a103c42d6b8151b60fbdf19c542d01662
JIT: keep ref count for runtime generic context lookups

Keep a ref count for runtime generic context lookups, and track when
an inlinee requires a runtime lookup but then ignores the resulting
context. Only report/keep the context alive if there are known uses.

This pattern happens frequently in inlined generic code that uses
type tests to extract properties of types.

Addresses dotnet/coreclr#1691.

Commit migrated from https://github.com/dotnet/coreclr/commit/5a1e02cd6f056cebdd1c240d400ac7a34234d43a
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/compiler.hpp
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/inline.h
src/coreclr/src/jit/lclvars.cpp
src/coreclr/src/jit/morph.cpp