foreach (MethodDesc method in Type.GetAllMethods())
{
- if (!method.IsGenericMethodDefinition && context.CompilationModuleGroup.VersionsWithMethodBody(method))
+ if (!method.IsGenericMethodDefinition &&
+ context.CompilationModuleGroup.ContainsMethodBody(method, false))
{
- dependencies.Add(context.MethodEntrypoint(method), $"Method on type {Type.ToString()}");
+ dependencies.Add(context.CompiledMethodNode(method), $"Method on type {Type.ToString()}");
}
}
{
// Require compilation of the canonical version for instantiating stubs
MethodDesc canonMethod = _method.Method.GetCanonMethodTarget(CanonicalFormKind.Specific);
- ISymbolNode canonMethodNode = factory.MethodEntrypoint(
- new MethodWithToken(canonMethod, _method.Token, constrainedType: null),
- isUnboxingStub: false,
- isInstantiatingStub: false,
- isPrecodeImportRequired: false);
- yield return new DependencyListEntry(canonMethodNode, "Canonical method for instantiating stub");
+ if (factory.CompilationModuleGroup.ContainsMethodBody(canonMethod, false))
+ {
+ ISymbolNode canonMethodNode = factory.CompiledMethodNode(canonMethod);
+ yield return new DependencyListEntry(canonMethodNode, "Canonical method for instantiating stub");
+ }
}
}
_markingComplete = true;
}
- public IMethodNode MethodEntrypoint(MethodDesc method)
+ public IMethodNode CompiledMethodNode(MethodDesc method)
{
EcmaModule module = ((EcmaMethod)method.GetTypicalMethodDefinition()).Module;
ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true);
- return MethodEntrypoint(
- new MethodWithToken(method, moduleToken, constrainedType: null),
- isUnboxingStub: false,
- isInstantiatingStub: false,
- isPrecodeImportRequired: false);
+
+ return CreateMethodEntrypointNodeHelper(new MethodWithToken(method, moduleToken, constrainedType: null));
}
private NodeCache<TypeDesc, AllMethodsOnTypeNode> _allMethodsOnType;
MethodDesc method = methodNode.Method;
MethodWithGCInfo methodCodeNode = methodNode as MethodWithGCInfo;
#if DEBUG
- IMethodNode methodNodeDebug = MethodEntrypoint(method);
+ EcmaModule module = ((EcmaMethod)method.GetTypicalMethodDefinition()).Module;
+ ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true);
+
+ IMethodNode methodNodeDebug = MethodEntrypoint(new MethodWithToken(method, moduleToken, constrainedType: null), false, false, false);
MethodWithGCInfo methodCodeNodeDebug = methodNodeDebug as MethodWithGCInfo;
if (methodCodeNodeDebug == null && methodNodeDebug is LocalMethodImport localMethodImport)
{
public void AddCompilationRoot(MethodDesc method, string reason)
{
MethodDesc canonMethod = method.GetCanonMethodTarget(CanonicalFormKind.Specific);
- IMethodNode methodEntryPoint = _factory.MethodEntrypoint(canonMethod);
- _rootAdder(methodEntryPoint, reason);
+ if (_factory.CompilationModuleGroup.ContainsMethodBody(canonMethod, false))
+ {
+ IMethodNode methodEntryPoint = _factory.CompiledMethodNode(canonMethod);
+ _rootAdder(methodEntryPoint, reason);
+ }
}
}
}