예제 #1
0
 public ISymbolNode ThreadStaticsOffsetSymbol(MetadataType type)
 {
     if (CompilationModuleGroup.ContainsType(type))
     {
         return(_threadStaticsOffset.GetOrAdd(type));
     }
     else
     {
         return(ExternSymbol(ThreadStaticsOffsetNode.GetMangledName(type)));
     }
 }
예제 #2
0
        private void CreateHostedNodeCaches()
        {
            _GCStaticDescs = new NodeCache <MetadataType, GCStaticDescNode>((MetadataType type) =>
            {
                return(new GCStaticDescNode(type, false));
            });

            _threadStaticGCStaticDescs = new NodeCache <MetadataType, GCStaticDescNode>((MetadataType type) =>
            {
                return(new GCStaticDescNode(type, true));
            });

            _threadStaticsOffset = new NodeCache <MetadataType, ISymbolNode>((MetadataType type) =>
            {
                if (CompilationModuleGroup.ContainsType(type))
                {
                    return(new ThreadStaticsOffsetNode(type, this));
                }
                else if (CompilationModuleGroup.ShouldReferenceThroughImportTable(type))
                {
                    return(new ImportedThreadStaticsOffsetNode(type, this));
                }
                else
                {
                    return(new ExternSymbolNode(ThreadStaticsOffsetNode.GetMangledName(NameMangler, type)));
                }
            });

            _importedThreadStaticsIndices = new NodeCache <MetadataType, ImportedThreadStaticsIndexNode>((MetadataType type) =>
            {
                return(new ImportedThreadStaticsIndexNode(this));
            });

            _hostedGenericDictionaryLayouts = new NodeCache <TypeSystemEntity, UtcDictionaryLayoutNode>((TypeSystemEntity methodOrType) =>
            {
                return(new UtcDictionaryLayoutNode(methodOrType));
            });

            _nonExternMethodSymbols = new NodeCache <MethodKey, NonExternMethodSymbolNode>((MethodKey method) =>
            {
                return(new NonExternMethodSymbolNode(this, method.Method, method.IsUnboxingStub));
            });

            _standaloneGCStaticDescs = new NodeCache <GCStaticDescNode, StandaloneGCStaticDescRegionNode>((GCStaticDescNode staticDesc) =>
            {
                return(new StandaloneGCStaticDescRegionNode(staticDesc));
            });
        }