diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-06-17 17:13:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-17 17:13:34 +0300 |
commit | 40e96e0cfb5f0f9e1fbb694d959e22f6dd0ee541 (patch) | |
tree | b1472ea2f470ebd2525052e1da3de74d77cb5761 /src/ILCompiler.Compiler | |
parent | fa35c23209a7ee81a1257f9c0e271feaab54d395 (diff) | |
parent | 75b6df17098d438ee16bd2f17e21cd7ac1589116 (diff) |
Merge pull request #5948 from dotnet/nmirror
Merge nmirror to master
Diffstat (limited to 'src/ILCompiler.Compiler')
20 files changed, 110 insertions, 34 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CompilerComparer.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CompilerComparer.cs index 2a564335e..b183b043c 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CompilerComparer.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/CompilerComparer.cs @@ -35,7 +35,7 @@ namespace ILCompiler.DependencyAnalysis else { Debug.Assert(x.GetType() != y.GetType()); - return codeX > codeY ? -1 : 1; + return codeY > codeX ? -1 : 1; } } } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternMethodSymbolNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternMethodSymbolNode.cs index 7602151b9..1aa1b3826 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternMethodSymbolNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternMethodSymbolNode.cs @@ -28,5 +28,7 @@ namespace ILCompiler.DependencyAnalysis return _method; } } + + protected internal override int ClassCode => -729061105; } } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternSymbolNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternSymbolNode.cs index f35a57d1c..3714fb7ba 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternSymbolNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ExternSymbolNode.cs @@ -14,7 +14,7 @@ namespace ILCompiler.DependencyAnalysis /// <summary> /// Represents a symbol that is defined externally and statically linked to the output obj file. /// </summary> - public class ExternSymbolNode : DependencyNodeCore<NodeFactory>, ISortableSymbolNode + public class ExternSymbolNode : SortableDependencyNode, ISortableSymbolNode { private Utf8String _name; @@ -42,12 +42,19 @@ namespace ILCompiler.DependencyAnalysis public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependencies(List<DependencyNodeCore<NodeFactory>> markedNodes, int firstNode, NodeFactory factory) => null; #if !SUPPORT_JIT - int ISortableSymbolNode.ClassCode => 1092559304; + protected internal override int ClassCode => 1092559304; - int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer) + protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer) { return _name.CompareTo(((ExternSymbolNode)other)._name); } + + int ISortableSymbolNode.ClassCode => ClassCode; + + int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer) + { + return CompareToImpl((SortableDependencyNode)other, comparer); + } #endif } } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/GCStaticDescNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/GCStaticDescNode.cs index 07d482d3e..e2bbaa68c 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/GCStaticDescNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/GCStaticDescNode.cs @@ -13,7 +13,7 @@ using Debug = System.Diagnostics.Debug; namespace ILCompiler.DependencyAnalysis { - public class GCStaticDescNode : EmbeddedObjectNode, ISymbolDefinitionNode + public class GCStaticDescNode : EmbeddedObjectNode, ISymbolDefinitionNode, ISortableSymbolNode { private MetadataType _type; private GCPointerMap _gcMap; @@ -177,21 +177,30 @@ namespace ILCompiler.DependencyAnalysis return compare != 0 ? compare : comparer.Compare(_type, other._type); } - protected internal override int ClassCode => 2142332918; - + protected sealed internal override int ClassCode => 2142332918; + protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer) { - return comparer.Compare(_type, ((GCStaticDescNode)other)._type); + return CompareTo((GCStaticDescNode)other, comparer); + } + + int ISortableSymbolNode.ClassCode => ClassCode; + + int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer) + { + return CompareToImpl((SortableDependencyNode)other, comparer); } } public class GCStaticDescRegionNode : ArrayOfEmbeddedDataNode<GCStaticDescNode> { - public GCStaticDescRegionNode(string startSymbolMangledName, string endSymbolMangledName) - : base(startSymbolMangledName, endSymbolMangledName, null) + public GCStaticDescRegionNode(string startSymbolMangledName, string endSymbolMangledName, IComparer<GCStaticDescNode> nodeSorter) + : base(startSymbolMangledName, endSymbolMangledName, nodeSorter) { } + protected internal override int ClassCode => 1312891560; + protected override void GetElementDataForNodes(ref ObjectDataBuilder builder, NodeFactory factory, bool relocsOnly) { int numSeries = 0; diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ImportedEETypeSymbolNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ImportedEETypeSymbolNode.cs index 1918de4af..9b039ac0b 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ImportedEETypeSymbolNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ImportedEETypeSymbolNode.cs @@ -31,5 +31,7 @@ namespace ILCompiler.DependencyAnalysis return _type; } } + + protected internal override int ClassCode => 395643063; } } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtImports.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtImports.cs index e7bce493e..51be3ea4a 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtImports.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtImports.cs @@ -23,42 +23,49 @@ namespace ILCompiler.DependencyAnalysis { public MrtImportedEETypeSymbolNode(TypeDesc type) : base(type) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => nameMangler.NodeMangler.EEType(Type); + protected internal override int ClassCode => 126598072; } public sealed class MrtImportedGCStaticSymbolNode : MrtImportWithTypeSymbol { public MrtImportedGCStaticSymbolNode(TypeDesc type) : base(type) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => GCStaticsNode.GetMangledName(Type, nameMangler); + protected internal override int ClassCode => 1974639431; } public sealed class MrtImportedNonGCStaticSymbolNode : MrtImportWithTypeSymbol { public MrtImportedNonGCStaticSymbolNode(TypeDesc type) : base(type) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => NonGCStaticsNode.GetMangledName(Type, nameMangler); + protected internal override int ClassCode => 257546392; } public sealed class MrtImportedThreadStaticOffsetSymbolNode : MrtImportWithTypeSymbol { public MrtImportedThreadStaticOffsetSymbolNode(TypeDesc type) : base(type) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => ThreadStaticsOffsetNode.GetMangledName(nameMangler, Type); + protected internal override int ClassCode => 1944978231; } public sealed class MrtImportedMethodDictionarySymbolNode : MrtImportWithMethodSymbol { public MrtImportedMethodDictionarySymbolNode(MethodDesc method) : base(method) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => nameMangler.NodeMangler.MethodGenericDictionary(Method); + protected internal override int ClassCode => 925274757; } public sealed class MrtImportedMethodCodeSymbolNode : MrtImportWithMethodSymbol, IMethodNode { public MrtImportedMethodCodeSymbolNode(MethodDesc method) : base(method) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => nameMangler.GetMangledMethodName(Method).ToString(); + protected internal override int ClassCode => -454606757; } public sealed class MrtImportedUnboxingMethodCodeSymbolNode : MrtImportWithMethodSymbol, IMethodNode { public MrtImportedUnboxingMethodCodeSymbolNode(MethodDesc method) : base(method) { } protected override sealed string GetNonImportedName(NameMangler nameMangler) => UnboxingStubNode.GetMangledName(nameMangler, Method); + protected internal override int ClassCode => 1712079609; } public abstract class MrtImportWithTypeSymbol : MrtImportNode diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs index 1b09590ca..c84326a55 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/NonExternMethodSymbolNode.cs @@ -34,7 +34,7 @@ namespace ILCompiler.DependencyAnalysis bool _hasCompiledBody; public NonExternMethodSymbolNode(NodeFactory factory, MethodDesc method, bool isUnboxing) - : base(isUnboxing ? UnboxingStubNode.GetMangledName(factory.NameMangler, method) : + : base(isUnboxing ? UnboxingStubNode.GetMangledName(factory.NameMangler, method) : factory.NameMangler.GetMangledMethodName(method)) { _isUnboxing = isUnboxing; @@ -149,6 +149,22 @@ namespace ILCompiler.DependencyAnalysis return dependencies; } + protected sealed internal override int ClassCode => -2124588118; + + protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer) + { + NonExternMethodSymbolNode otherMethod = (NonExternMethodSymbolNode)other; + var result = _isUnboxing.CompareTo(otherMethod._isUnboxing); + return result != 0 ? result : comparer.Compare(_method, otherMethod._method); + } + + int ISortableSymbolNode.ClassCode => ClassCode; + + int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer) + { + return CompareToImpl((SortableDependencyNode)other, comparer); + } + private class FuncletSymbol : ISymbolNodeWithFuncletId { public FuncletSymbol(NonExternMethodSymbolNode methodSymbol, int funcletId) diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ObjectNodeSection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ObjectNodeSection.cs index 86c6a3178..e9eaf77c7 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ObjectNodeSection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ObjectNodeSection.cs @@ -46,7 +46,7 @@ namespace ILCompiler.DependencyAnalysis public static readonly ObjectNodeSection XDataSection = new ObjectNodeSection("xdata", SectionType.ReadOnly); public static readonly ObjectNodeSection DataSection = new ObjectNodeSection("data", SectionType.Writeable); public static readonly ObjectNodeSection ReadOnlyDataSection = new ObjectNodeSection("rdata", SectionType.ReadOnly); - public static readonly ObjectNodeSection FoldableReadOnlyDataSection = new ObjectNodeSection("rdata$ICF", SectionType.ReadOnly); + public static readonly ObjectNodeSection FoldableReadOnlyDataSection = new ObjectNodeSection("rdata$F", SectionType.ReadOnly); public static readonly ObjectNodeSection TextSection = new ObjectNodeSection("text", SectionType.Executable); public static readonly ObjectNodeSection TLSSection = new ObjectNodeSection("TLS", SectionType.Writeable); } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs index 909edfae4..3a91c46fe 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs @@ -27,5 +27,12 @@ namespace ILCompiler.DependencyAnalysis return _method; } } + + protected internal override int ClassCode => -1173492615; + + protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer) + { + return comparer.Compare(_method, ((RuntimeImportMethodNode)other)._method); + } } } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/SortableDependencyNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/SortableDependencyNode.cs index 1ba436301..9f2443f6f 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/SortableDependencyNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/SortableDependencyNode.cs @@ -80,7 +80,13 @@ namespace ILCompiler.DependencyAnalysis ExternalReferencesTableNode, StackTraceEmbeddedMetadataNode, StackTraceMethodMappingNode, - ArrayOfEmbeddedDataNode + ArrayOfEmbeddedDataNode, + WindowsDebugNeedTypeIndicesStoreNode, + WindowsDebugMethodSignatureMapSectionNode, + WindowsDebugTypeSignatureMapSectionNode, + WindowsDebugManagedNativeDictionaryInfoSectionNode, + WindowsDebugTypeRecordsSectionNode, + WindowsDebugPseudoAssemblySectionNode, } public class EmbeddedObjectNodeComparer : IComparer<EmbeddedObjectNode> @@ -159,7 +165,7 @@ namespace ILCompiler.DependencyAnalysis else { Debug.Assert(x.GetType() != y.GetType()); - return codeX - codeY; + return codeY > codeX ? -1 : 1; } } else diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ThreadStaticsOffsetNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ThreadStaticsOffsetNode.cs index 096ebe98a..ee529a816 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ThreadStaticsOffsetNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/ThreadStaticsOffsetNode.cs @@ -74,14 +74,14 @@ namespace ILCompiler.DependencyAnalysis builder.EmitReloc(factory.TypeThreadStaticsSymbol(_type), RelocType.IMAGE_REL_SECREL); } - protected internal override int ClassCode => 419394032; + sealed protected internal override int ClassCode => 419394032; protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer) { return comparer.Compare(_type, ((ThreadStaticsOffsetNode)other)._type); } - int ISortableSymbolNode.ClassCode => 419394032; + int ISortableSymbolNode.ClassCode => ClassCode; int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer) { diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs index 776ca6a2b..490fcf309 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs @@ -251,16 +251,18 @@ namespace ILCompiler public GCStaticDescRegionNode GCStaticDescRegion = new GCStaticDescRegionNode( CompilationUnitPrefix + "__GCStaticDescStart", - CompilationUnitPrefix + "__GCStaticDescEnd"); + CompilationUnitPrefix + "__GCStaticDescEnd", + new SortableDependencyNode.EmbeddedObjectNodeComparer(new CompilerComparer())); public GCStaticDescRegionNode ThreadStaticGCDescRegion = new GCStaticDescRegionNode( CompilationUnitPrefix + "__ThreadStaticGCDescStart", - CompilationUnitPrefix + "__ThreadStaticGCDescEnd"); + CompilationUnitPrefix + "__ThreadStaticGCDescEnd", + new SortableDependencyNode.EmbeddedObjectNodeComparer(new CompilerComparer())); public ArrayOfEmbeddedDataNode<ThreadStaticsOffsetNode> ThreadStaticsOffsetRegion = new ArrayOfEmbeddedDataNode<ThreadStaticsOffsetNode>( CompilationUnitPrefix + "__ThreadStaticOffsetRegionStart", CompilationUnitPrefix + "__ThreadStaticOffsetRegionEnd", - null); + new SortableDependencyNode.EmbeddedObjectNodeComparer(new CompilerComparer())); public ThreadStaticsIndexNode ThreadStaticsIndex; diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcThreadStaticsNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcThreadStaticsNode.cs index 3aeadde41..2495fb84d 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcThreadStaticsNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcThreadStaticsNode.cs @@ -7,7 +7,7 @@ using Internal.TypeSystem; namespace ILCompiler.DependencyAnalysis { - public class UtcThreadStaticsNode : ObjectNode, ISymbolDefinitionNode + public class UtcThreadStaticsNode : ObjectNode, ISymbolDefinitionNode, ISymbolNodeWithDebugInfo, ISortableSymbolNode { private MetadataType _type; @@ -26,6 +26,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; public MetadataType Type => _type; + public IDebugInfo DebugInfo => NullTypeIndexDebugInfo.Instance; + public static string GetMangledName(TypeDesc type, NameMangler nameMangler) { return nameMangler.NodeMangler.ThreadStatics(type); @@ -61,6 +63,19 @@ namespace ILCompiler.DependencyAnalysis return builder.ToObjectData(); } - protected internal override int ClassCode => -1421136129; + protected sealed internal override int ClassCode => -1421136129; + + protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer) + { + return comparer.Compare(_type, ((UtcThreadStaticsNode)other)._type); + } + + int ISortableSymbolNode.ClassCode => ClassCode; + + int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer) + { + return CompareToImpl((ObjectNode)other, comparer); + } + } } diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugManagedNativeDictionaryInfoSection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugManagedNativeDictionaryInfoSection.cs index 5d3ebd6e7..9d3e33deb 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugManagedNativeDictionaryInfoSection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugManagedNativeDictionaryInfoSection.cs @@ -30,7 +30,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; - protected internal override int ClassCode => 1502860768; + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + protected internal override int ClassCode => (int)ObjectNodeOrder.WindowsDebugManagedNativeDictionaryInfoSectionNode; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs index c351d54e8..da8596c16 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugMethodMapSection.cs @@ -30,7 +30,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; - protected internal override int ClassCode => -2063194124; + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + protected internal override int ClassCode => (int)ObjectNodeOrder.WindowsDebugMethodSignatureMapSectionNode; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { @@ -178,9 +179,6 @@ namespace ILCompiler.DependencyAnalysis if (relocsOnly) return new ObjectData(Array.Empty<byte>(), Array.Empty<Relocation>(), 1, new ISymbolDefinitionNode[] { this }); - if (factory.WindowsDebugData.DebugTypeRecordsSection != null) - factory.WindowsDebugData.DebugTypeRecordsSection.Neuter(); - List<Relocation> relocations = new List<Relocation>(); DebugInfoBlob debugData = GetDebugMethodRVAToTokenMap(factory.WindowsDebugData.DebugPseudoAssemblySection.PseudoAssembly, factory.MetadataManager.GetCompiledMethodBodies(), out relocations); diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugNeedTypeIndicesStoreNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugNeedTypeIndicesStoreNode.cs index 71435021c..c52a7ea1d 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugNeedTypeIndicesStoreNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugNeedTypeIndicesStoreNode.cs @@ -21,7 +21,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; - protected internal override int ClassCode => 1275723356; + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + protected internal override int ClassCode => (int)ObjectNodeOrder.WindowsDebugNeedTypeIndicesStoreNode; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugPseudoAssemblySection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugPseudoAssemblySection.cs index 7f393b2d4..4b3e55177 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugPseudoAssemblySection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugPseudoAssemblySection.cs @@ -29,7 +29,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; - protected internal override int ClassCode => 920778380; + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + protected internal override int ClassCode => (int)ObjectNodeOrder.WindowsDebugPseudoAssemblySectionNode; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeRecordsSection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeRecordsSection.cs index 8c722c001..543f213f9 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeRecordsSection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeRecordsSection.cs @@ -33,7 +33,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; - protected internal override int ClassCode => -2081034825; + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + protected internal override int ClassCode => (int)ObjectNodeOrder.WindowsDebugTypeRecordsSectionNode; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeSignatureMapSection.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeSignatureMapSection.cs index 0ec387d9c..f40ff4e87 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeSignatureMapSection.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/WindowsDebugTypeSignatureMapSection.cs @@ -31,7 +31,8 @@ namespace ILCompiler.DependencyAnalysis public int Offset => 0; - protected internal override int ClassCode => 1029840999; + protected internal override int Phase => (int)ObjectNodePhase.Ordered; + protected internal override int ClassCode => (int)ObjectNodeOrder.WindowsDebugTypeSignatureMapSectionNode; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { @@ -129,9 +130,6 @@ namespace ILCompiler.DependencyAnalysis if (relocsOnly) return new ObjectData(Array.Empty<byte>(), Array.Empty<Relocation>(), 1, new ISymbolDefinitionNode[] { this }); - if (factory.WindowsDebugData.DebugTypeRecordsSection != null) - factory.WindowsDebugData.DebugTypeRecordsSection.Neuter(); - DebugInfoBlob debugData = GetDebugTypeIndexToTokenMap(factory.WindowsDebugData.DebugPseudoAssemblySection.PseudoAssembly, factory.WindowsDebugData.UserDefinedTypeDescriptor.CompleteKnownTypes); return new ObjectData(debugData.ToArray(), Array.Empty<Relocation>(), 1, new ISymbolDefinitionNode[] { this }); diff --git a/src/ILCompiler.Compiler/src/Compiler/WindowsNodeMangler.cs b/src/ILCompiler.Compiler/src/Compiler/WindowsNodeMangler.cs index 81f5e1592..0c3d3163a 100644 --- a/src/ILCompiler.Compiler/src/Compiler/WindowsNodeMangler.cs +++ b/src/ILCompiler.Compiler/src/Compiler/WindowsNodeMangler.cs @@ -47,7 +47,10 @@ namespace ILCompiler public sealed override string ThreadStatics(TypeDesc type) { - return NameMangler.CompilationUnitPrefix + NameMangler.GetMangledTypeName(type) + "::" + ThreadStaticMemberName; + if (type.Context.Target.Abi == TargetAbi.ProjectN) + return NameMangler.GetMangledTypeName(type) + "::" + ThreadStaticMemberName; + else + return NameMangler.CompilationUnitPrefix + NameMangler.GetMangledTypeName(type) + "::" + ThreadStaticMemberName; } public sealed override string TypeGenericDictionary(TypeDesc type) |