JIT: recover types from helper calls and more (dotnet/coreclr#20447)
authorAndy Ayers <andya@microsoft.com>
Wed, 24 Oct 2018 00:00:11 +0000 (17:00 -0700)
committerGitHub <noreply@github.com>
Wed, 24 Oct 2018 00:00:11 +0000 (17:00 -0700)
commit51f6e745ea2de61f015e201d144a2e5502f940da
treeb03a71118d3e5a287c16675b89692ce2dabfa495
parentcbca8f9a49503ee4e3aec7f3d9263601143c2f31
JIT: recover types from helper calls and more (dotnet/coreclr#20447)

The jit needs to recover class handles in order to devirtualize and
do other type-based optimizations. This change allows the jit to find
the type for more trees: in particular, helper calls, intrinsics, and
expanded static field accesses.

Also, annotate a few methods to control jit optimization

We don't want to optimize special methods that are used to inform crossgen
about desirable generic instantiations. `CommonlyUsedGenericInstantiations`
was already annotated but `CommonlyUsedWinRTRedirectedInterfaceStubs` wasn't.

And because `RuntimeType` is sealed calls through types are now often
devirtualized. Name lookups on types are frequent, especially on error paths.
The method `GetCachedName` looks like an attractive inline but simply expands
into a larger sequence of two other calls. So block it from being inlined.

Commit migrated from https://github.com/dotnet/coreclr/commit/5af4d641711ba91d6bfa5bcdc510e35cec108754
src/coreclr/src/System.Private.CoreLib/src/System/Internal.cs
src/coreclr/src/System.Private.CoreLib/src/System/RtType.cs
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/importer.cpp