Пример #1
0
 public ISortableSymbolNode TypeThreadStaticsIndexSymbol(MetadataType type)
 {
     if (CompilationModuleGroup.ContainsType(type) && !CompilationModuleGroup.ShouldReferenceThroughImportTable(type))
     {
         return(ThreadStaticsIndex);
     }
     else
     {
         return(_importedNodeProvider.ImportedThreadStaticIndexNode(this, type));
     }
 }
Пример #2
0
 public ISortableSymbolNode TypeThreadStaticsIndexSymbol(TypeDesc type)
 {
     if (CompilationModuleGroup.ContainsType(type))
     {
         return(ThreadStaticsIndex);
     }
     else if (CompilationModuleGroup.ShouldReferenceThroughImportTable(type))
     {
         return(_importedThreadStaticsIndices.GetOrAdd((MetadataType)type));
     }
     else
     {
         return(ExternSymbol(ThreadStaticsIndexNode.GetMangledName((NameMangler as UTCNameMangler).GetImportedTlsIndexPrefix())));
     }
 }
Пример #3
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));
            });
        }
Пример #4
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, ISortableSymbolNode>((MetadataType type) =>
            {
                if (CompilationModuleGroup.ContainsType(type) && !(CompilationModuleGroup.ShouldReferenceThroughImportTable(type)))
                {
                    return(new ThreadStaticsOffsetNode(type, this));
                }
                else
                {
                    return(_importedNodeProvider.ImportedThreadStaticOffsetNode(this, type));
                }
            });

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

            _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));
            });
        }