Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFact

dependencyList.Add(factory.VTable(closestDefType), "VTable");

if (_type.IsCanonicalSubtype(CanonicalFormKind.Any))
{
// Track generic virtual methods that will get added to the GVM tables
if ((_virtualMethodAnalysisFlags & VirtualMethodAnalysisFlags.NeedsGvmEntries) != 0)
{
dependencyList.Add(new DependencyListEntry(factory.TypeGVMEntries(_type.GetTypeDefinition()), "Type with generic virtual methods"));
}
}
else
if (!_type.IsCanonicalSubtype(CanonicalFormKind.Any))
{
factory.InteropStubManager.AddInterestingInteropConstructedTypeDependencies(ref dependencyList, factory, _type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,6 @@ protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFact
// Generated type contains generic virtual methods that will get added to the GVM tables
if ((_virtualMethodAnalysisFlags & VirtualMethodAnalysisFlags.NeedsGvmEntries) != 0)
{
dependencies.Add(new DependencyListEntry(factory.TypeGVMEntries(_type.GetTypeDefinition()), "Type with generic virtual methods"));

TypeDesc canonicalType = _type.ConvertToCanonForm(CanonicalFormKind.Specific);
if (canonicalType != _type)
dependencies.Add(factory.ConstructedTypeSymbol(canonicalType), "Type with generic virtual methods");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ public GVMDependenciesNode(MethodDesc method)
public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory factory)
{
if (!_method.IsAbstract)
{
yield return new DependencyListEntry(factory.GenericVirtualMethodImpl(_method), "Implementation of the generic virtual method");
}

if (!_method.OwningType.IsInterface)
{
yield return new DependencyListEntry(factory.TypeGVMEntries(_method.OwningType.GetTypeDefinition()), "Resolution metadata");
}
}

public override IEnumerable<CombinedDependencyListEntry> GetConditionalStaticDependencies(NodeFactory context) => null;
Expand Down Expand Up @@ -95,6 +102,8 @@ public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependenci
potentialOverrideType.ConvertToCanonForm(CanonicalFormKind.Specific) != potentialOverrideType)
continue;

bool foundImpl = false;

// If this is an interface gvm, look for types that implement the interface
// and other instantantiations that have the same canonical form.
// This ensure the various slot numbers remain equivalent across all types where there is an equivalence
Expand Down Expand Up @@ -150,6 +159,8 @@ public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependenci
TypeSystemEntity origin = (implementingMethodInstantiation.OwningType != potentialOverrideType) ? potentialOverrideType : null;
factory.MetadataManager.NoteOverridingMethod(_method, implementingMethodInstantiation, origin);
}

foundImpl = true;
}
}
}
Expand Down Expand Up @@ -201,7 +212,20 @@ public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependenci
factory.GenericVirtualMethodImpl(instantiatedTargetMethod), null, "DerivedMethodInstantiation"));

factory.MetadataManager.NoteOverridingMethod(_method, instantiatedTargetMethod);

foundImpl = true;
}
}

if (foundImpl)
{
TypeDesc currentType = potentialOverrideType;
do
{
dynamicDependencies.Add(new CombinedDependencyListEntry(factory.TypeGVMEntries(currentType.GetTypeDefinition()), null, "Resolution metadata"));
currentType = currentType.BaseType;
}
while (currentType != null);
}
}

Expand Down
Loading