_markingComplete = true;
}
- public IMethodNode CompiledMethodNode(MethodDesc method)
- {
- EcmaModule module = ((EcmaMethod)method.GetTypicalMethodDefinition()).Module;
- ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true);
+ private NodeCache<MethodDesc, MethodWithGCInfo> _localMethodCache;
- return CreateMethodEntrypointNodeHelper(new MethodWithToken(method, moduleToken, constrainedType: null));
+ public MethodWithGCInfo CompiledMethodNode(MethodDesc method)
+ {
+ Debug.Assert(CompilationModuleGroup.ContainsMethodBody(method, false));
+ Debug.Assert(method == method.GetCanonMethodTarget(CanonicalFormKind.Specific));
+ return _localMethodCache.GetOrAdd(method);
}
private NodeCache<TypeDesc, AllMethodsOnTypeNode> _allMethodsOnType;
public AllMethodsOnTypeNode AllMethodsOnType(TypeDesc type)
{
- return _allMethodsOnType.GetOrAdd(type);
+ return _allMethodsOnType.GetOrAdd(type.ConvertToCanonForm(CanonicalFormKind.Specific));
}
private NodeCache<ReadyToRunGenericHelperKey, ISymbolNode> _genericReadyToRunHelpersFromDict;
bool isUnboxingStub = key.IsUnboxingStub;
bool isInstantiatingStub = key.IsInstantiatingStub;
bool isPrecodeImportRequired = key.IsPrecodeImportRequired;
- if (CompilationModuleGroup.ContainsMethodBody(method.Method, false))
+ MethodDesc compilableMethod = method.Method.GetCanonMethodTarget(CanonicalFormKind.Specific);
+ if (CompilationModuleGroup.ContainsMethodBody(compilableMethod, false))
{
if (isPrecodeImportRequired)
{
this,
ReadyToRunFixupKind.MethodEntry,
method,
- CreateMethodEntrypointNodeHelper(method),
+ CompiledMethodNode(compilableMethod),
isUnboxingStub,
isInstantiatingStub);
}
this,
ReadyToRunFixupKind.MethodEntry,
method,
- CreateMethodEntrypointNodeHelper(method),
+ CompiledMethodNode(compilableMethod),
isUnboxingStub,
isInstantiatingStub);
}
return _importMethods.GetOrAdd(key);
}
- private NodeCache<MethodDesc, MethodWithGCInfo> _localMethodCache;
-
- private MethodWithGCInfo CreateMethodEntrypointNodeHelper(MethodWithToken targetMethod)
- {
- Debug.Assert(CompilationModuleGroup.ContainsMethodBody(targetMethod.Method, false));
-
- return _localMethodCache.GetOrAdd(targetMethod.Method);
- }
-
public IEnumerable<MethodWithGCInfo> EnumerateCompiledMethods()
{
return EnumerateCompiledMethods(null, CompiledMethodCategory.All);