public IEnumerable <MethodWithGCInfo> EnumerateCompiledMethods(EcmaModule moduleToEnumerate, CompiledMethodCategory methodCategory) { foreach (IMethodNode methodNode in MetadataManager.GetCompiledMethods(moduleToEnumerate, methodCategory)) { MethodDesc method = methodNode.Method; MethodWithGCInfo methodCodeNode = methodNode as MethodWithGCInfo; #if DEBUG EcmaModule module = ((EcmaMethod)method.GetTypicalMethodDefinition()).Module; ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true); IMethodNode methodNodeDebug = MethodEntrypoint(new MethodWithToken(method, moduleToken, constrainedType: null, unboxing: false, context: null), false, false, false); MethodWithGCInfo methodCodeNodeDebug = methodNodeDebug as MethodWithGCInfo; if (methodCodeNodeDebug == null && methodNodeDebug is DelayLoadMethodImport DelayLoadMethodImport) { methodCodeNodeDebug = DelayLoadMethodImport.MethodCodeNode; } if (methodCodeNodeDebug == null && methodNodeDebug is PrecodeMethodImport precodeMethodImport) { methodCodeNodeDebug = precodeMethodImport.MethodCodeNode; } Debug.Assert(methodCodeNodeDebug == methodCodeNode); #endif if (methodCodeNode != null && !methodCodeNode.IsEmpty) { yield return(methodCodeNode); } } }
protected override IMethodNode CreateMethodEntrypointNode(MethodDesc method) { ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true); return(MethodEntrypoint(method, constrainedType: null, originalMethod: null, methodToken: moduleToken, signatureContext: InputModuleContext, isUnboxingStub: false, isInstantiatingStub: false)); }
protected override IMethodNode CreateMethodEntrypointNode(MethodDesc method) { ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true); return(MethodEntrypoint( new MethodWithToken(method, moduleToken, constrainedType: null), isUnboxingStub: false, isInstantiatingStub: false, isPrecodeImportRequired: false, signatureContext: InputModuleContext)); }