public override IEnumerable <CombinedDependencyListEntry> GetConditionalStaticDependencies(NodeFactory factory) { if (!factory.MetadataManager.SupportsReflection) { return(Array.Empty <CombinedDependencyListEntry>()); } List <CombinedDependencyListEntry> conditionalDependencies = new List <CombinedDependencyListEntry>(); NativeLayoutSavedVertexNode templateLayout; if (_dictionaryOwner is MethodDesc) { templateLayout = factory.NativeLayout.TemplateMethodLayout((MethodDesc)_dictionaryOwner); conditionalDependencies.Add(new CombinedDependencyListEntry(_lookupSignature.TemplateDictionaryNode(factory), templateLayout, "Type loader template")); } else { templateLayout = factory.NativeLayout.TemplateTypeLayout((TypeDesc)_dictionaryOwner); conditionalDependencies.Add(new CombinedDependencyListEntry(_lookupSignature.TemplateDictionaryNode(factory), templateLayout, "Type loader template")); } if (_id == ReadyToRunHelperId.GetGCStaticBase || _id == ReadyToRunHelperId.GetThreadStaticBase) { // If the type has a lazy static constructor, we also need the non-GC static base to be available as // a template dictionary node. TypeDesc type = (TypeDesc)_target; Debug.Assert(templateLayout != null); if (factory.TypeSystemContext.HasLazyStaticConstructor(type)) { GenericLookupResult nonGcRegionLookup = factory.GenericLookup.TypeNonGCStaticBase(type); conditionalDependencies.Add(new CombinedDependencyListEntry(nonGcRegionLookup.TemplateDictionaryNode(factory), templateLayout, "Type loader template")); } } return(conditionalDependencies); }