diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-10-18 03:39:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 03:39:13 +0300 |
commit | 53f2da1da47159b7b4dd39de53e0887ab9a013e8 (patch) | |
tree | 1008c137f87955ed7c5b482219b850455a5ec48e /src/ILCompiler.Compiler | |
parent | 1fca2dfcbc764702cc6a100d2edabc205069b8e5 (diff) | |
parent | 22d3a015a8240a03d4a5237968ea7997647ecaa5 (diff) |
Merge pull request #4747 from dotnet/nmirror
Merge nmirror to master
Diffstat (limited to 'src/ILCompiler.Compiler')
3 files changed, 16 insertions, 4 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs index b96c74f43..bed14da6e 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CodeBasedDependencyAlgorithm.cs @@ -29,7 +29,7 @@ namespace ILCompiler.DependencyAnalysis dependencies = new DependencyList(); if (factory.MetadataManager.HasReflectionInvokeStubForInvokableMethod(method) - && ((factory.Target.Abi != TargetAbi.ProjectN) || !method.IsCanonicalMethod(CanonicalFormKind.Any))) + && ((factory.Target.Abi != TargetAbi.ProjectN) || ProjectNDependencyBehavior.EnableFullAnalysis || !method.IsCanonicalMethod(CanonicalFormKind.Any))) { MethodDesc canonInvokeStub = factory.MetadataManager.GetCanonicalReflectionInvokeStub(method); if (canonInvokeStub.IsSharedByGenericInstantiations) @@ -42,7 +42,7 @@ namespace ILCompiler.DependencyAnalysis } bool skipUnboxingStubDependency = false; - if (factory.Target.Abi == TargetAbi.ProjectN) + if ((factory.Target.Abi == TargetAbi.ProjectN) && !ProjectNDependencyBehavior.EnableFullAnalysis) { // ProjectN compilation currently computes the presence of these stubs independent from dependency analysis here // TODO: fix that issue and remove this odd treatment of unboxing stubs diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs index 030bacaa2..22923129f 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs @@ -39,6 +39,10 @@ namespace ILCompiler.DependencyAnalysis { _isUnboxing = isUnboxing; _method = method; + + // Ensure all method bodies are fully canonicalized or not at all. + Debug.Assert(!method.IsCanonicalMethod(CanonicalFormKind.Any) || (method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method)); + Debug.Assert(!method.IsCanonicalMethod(CanonicalFormKind.Universal) || (method.GetCanonMethodTarget(CanonicalFormKind.Universal) == method)); } protected override string GetName(NodeFactory factory) => "Non" + base.GetName(factory); diff --git a/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs b/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs index 3c901f52c..ed9478ceb 100644 --- a/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs +++ b/src/ILCompiler.Compiler/src/Compiler/PrecomputedMetadataManager.cs @@ -729,8 +729,16 @@ namespace ILCompiler { Debug.Assert(IsReflectionInvokable(method)); - if (method.IsCanonicalMethod(CanonicalFormKind.Any)) - return false; + if (!ProjectNDependencyBehavior.EnableFullAnalysis) + { + if (method.IsCanonicalMethod(CanonicalFormKind.Any)) + return false; + } + else + { + if (method.IsCanonicalMethod(CanonicalFormKind.Universal)) + return false; + } MethodDesc reflectionInvokeStub = GetCanonicalReflectionInvokeStub(method); |