diff options
author | Michal Strehovský <michals@microsoft.com> | 2017-12-01 22:07:42 +0300 |
---|---|---|
committer | Michal Strehovský <michals@microsoft.com> | 2017-12-01 22:07:42 +0300 |
commit | 960759f69d0f3f73889ffbc04998d6505834b0a5 (patch) | |
tree | 3677b913bb1602943d7f388acf9d9009738368d5 /src/System.Private.Jit | |
parent | d80ed0826bdf262c4e67bea33945695c5a0f8cb7 (diff) |
Drive devirtualization using scanner's results
Diffstat (limited to 'src/System.Private.Jit')
-rw-r--r-- | src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs | 17 | ||||
-rw-r--r-- | src/System.Private.Jit/src/System.Private.Jit.csproj | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs index 85eb8a03c..e628978b9 100644 --- a/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs +++ b/src/System.Private.Jit/src/Internal/Runtime/JitSupport/JitCompilation.cs @@ -23,6 +23,7 @@ namespace ILCompiler _typeGetTypeMethodThunks = new TypeGetTypeMethodThunkCache(context.GetWellKnownType(WellKnownType.Object)); _methodILCache = new ILProvider(new PInvokeILProvider(new PInvokeILEmitterConfiguration(forceLazyResolution: true), null)); _nodeFactory = new NodeFactory(context); + _devirtualizationManager = new DevirtualizationManager(); } private readonly NodeFactory _nodeFactory; @@ -30,6 +31,7 @@ namespace ILCompiler protected readonly Logger _logger = Logger.Null; private readonly TypeGetTypeMethodThunkCache _typeGetTypeMethodThunks; private ILProvider _methodILCache; + private readonly DevirtualizationManager _devirtualizationManager; internal Logger Logger => _logger; @@ -102,6 +104,21 @@ namespace ILCompiler return true; } + public bool IsEffectivelySealed(TypeDesc type) + { + return _devirtualizationManager.IsEffectivelySealed(type); + } + + public bool IsEffectivelySealed(MethodDesc method) + { + return _devirtualizationManager.IsEffectivelySealed(method); + } + + public MethodDesc ResolveVirtualMethod(MethodDesc declMethod, TypeDesc implType) + { + return _devirtualizationManager.ResolveVirtualMethod(declMethod, implType); + } + public bool NeedsRuntimeLookup(ReadyToRunHelperId lookupKind, object targetOfLookup) { // The current plan seem to be to copy paste from ILCompiler.Compilation, but that's not a sustainable plan diff --git a/src/System.Private.Jit/src/System.Private.Jit.csproj b/src/System.Private.Jit/src/System.Private.Jit.csproj index 5df579bb4..270c33469 100644 --- a/src/System.Private.Jit/src/System.Private.Jit.csproj +++ b/src/System.Private.Jit/src/System.Private.Jit.csproj @@ -134,6 +134,7 @@ <Compile Include="$(ILCompilerBasePath)\Compiler\TypeExtensions.cs" /> <Compile Include="$(ILCompilerBasePath)\Compiler\NameMangler.cs" /> <Compile Include="$(ILCompilerBasePath)\Compiler\NodeMangler.cs" /> + <Compile Include="$(ILCompilerBasePath)\Compiler\DevirtualizationManager.cs" /> <Compile Include="$(ILCompilerBasePath)\IL\Stubs\PInvokeILProvider.cs" /> <Compile Include="$(DependencyAnalysisFrameworkBasePath)\IDependencyNode.cs" /> <Compile Include="$(DependencyAnalysisFrameworkBasePath)\DependencyNode.cs" /> |