diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2017-05-21 08:46:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-21 08:46:48 +0300 |
commit | 96e254c2763011780c87e701c78d513e7793b6d3 (patch) | |
tree | f3e4baf29c34db105c3c8b7a57cbe3d43b73d742 /src | |
parent | 8eb9ffe39300ca9647546580d1ee071a0c8de34d (diff) |
Delete reflection workaround in ShadowConcreteMethod (#3665)
This was needed when we weren't using the type loader to load invoke
stub dictionaries. This hasn't been needed for months.
Diffstat (limited to 'src')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs | 3 | ||||
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs | 20 |
2 files changed, 2 insertions, 21 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs index 3cd077ae3..67540126d 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs @@ -28,7 +28,8 @@ namespace ILCompiler.DependencyAnalysis if (dependencies == null) dependencies = new DependencyList(); - if (factory.MetadataManager.HasReflectionInvokeStubForInvokableMethod(method) && !method.IsCanonicalMethod(CanonicalFormKind.Any) /* Shared generics handled in the shadow concrete method node */) + if (factory.MetadataManager.HasReflectionInvokeStubForInvokableMethod(method) + && (factory.Target.Abi != TargetAbi.ProjectN) || !method.IsCanonicalMethod(CanonicalFormKind.Any)) { MethodDesc canonInvokeStub = factory.MetadataManager.GetCanonicalReflectionInvokeStub(method); if (canonInvokeStub.IsSharedByGenericInstantiations) diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs index 6566b0f67..cb5e24e64 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ShadowConcreteMethodNode.cs @@ -78,26 +78,6 @@ namespace ILCompiler.DependencyAnalysis } } - if (factory.Target.Abi == TargetAbi.CoreRT) - { - // TODO: https://github.com/dotnet/corert/issues/3224 - // Reflection invoke stub handling is here because in the current reflection model we reflection-enable - // all methods that are compiled. Ideally the list of reflection enabled methods should be known before - // we even start the compilation process (with the invocation stubs being compilation roots like any other). - // The existing model has it's problems: e.g. the invocability of the method depends on inliner decisions. - if (factory.MetadataManager.HasReflectionInvokeStub(Method)) - { - MethodDesc canonInvokeStub = factory.MetadataManager.GetCanonicalReflectionInvokeStub(Method); - if (canonInvokeStub.IsSharedByGenericInstantiations) - { - dependencies.Add(new DependencyListEntry(factory.MetadataManager.DynamicInvokeTemplateData, "Reflection invoke template data")); - factory.MetadataManager.DynamicInvokeTemplateData.AddDependenciesDueToInvokeTemplatePresence(ref dependencies, factory, canonInvokeStub); - } - else - dependencies.Add(new DependencyListEntry(factory.MethodEntrypoint(canonInvokeStub), "Reflection invoke")); - } - } - if (Method.HasInstantiation) { if (Method.IsVirtual) |