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)
commit5a1e02cd6f056cebdd1c240d400ac7a34234d43a
treeabf154eb871871d0e797dbcd25e6459903cbdc1f
parentcdea3db0927e279c6d9bd6531bff84e4cbd94eaa
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 #1691.
src/jit/compiler.cpp
src/jit/compiler.h
src/jit/compiler.hpp
src/jit/flowgraph.cpp
src/jit/importer.cpp
src/jit/inline.h
src/jit/lclvars.cpp
src/jit/morph.cpp