diff options
author | Andy Ayers <andya@microsoft.com> | 2018-10-23 17:00:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 17:00:11 -0700 |
commit | 5af4d641711ba91d6bfa5bcdc510e35cec108754 (patch) | |
tree | 88e3885fb2fc8ca4f6617a5e2797eb6b62bdcb26 /src/System.Private.CoreLib/src/System/RtType.cs | |
parent | f53df5b2ac4c3417e0777cb8fe2fca9cf011ede1 (diff) | |
download | coreclr-5af4d641711ba91d6bfa5bcdc510e35cec108754.tar.gz coreclr-5af4d641711ba91d6bfa5bcdc510e35cec108754.tar.bz2 coreclr-5af4d641711ba91d6bfa5bcdc510e35cec108754.zip |
JIT: recover types from helper calls and more (#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.
Diffstat (limited to 'src/System.Private.CoreLib/src/System/RtType.cs')
-rw-r--r-- | src/System.Private.CoreLib/src/System/RtType.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/src/System/RtType.cs b/src/System.Private.CoreLib/src/System/RtType.cs index 0e5cf8104e..63cf950d9d 100644 --- a/src/System.Private.CoreLib/src/System/RtType.cs +++ b/src/System.Private.CoreLib/src/System/RtType.cs @@ -4532,6 +4532,10 @@ namespace System } } + // This method looks like an attractive inline but expands to two calls, + // neither of which can be inlined or optimized further. So block it + // from inlining. + [MethodImpl(MethodImplOptions.NoInlining)] private string GetCachedName(TypeNameKind kind) { return Cache.GetName(kind); |