Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs')
-rw-r--r--src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs64
1 files changed, 46 insertions, 18 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs
index 776ca6a2b..80aec11b0 100644
--- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs
+++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/UtcNodeFactory.cs
@@ -59,7 +59,7 @@ namespace ILCompiler
return null;
}
- private static MetadataManager PickMetadataManager(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, IEnumerable<ModuleDesc> inputModules, IEnumerable<ModuleDesc> inputMetadataOnlyAssemblies, string metadataFile)
+ private static MetadataManager PickMetadataManager(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, IEnumerable<ModuleDesc> inputModules, IEnumerable<ModuleDesc> inputMetadataOnlyAssemblies, string metadataFile, bool emitStackTraceMetadata, bool disableExceptionMessages, bool disableInvokeThunks)
{
if (metadataFile == null)
{
@@ -67,7 +67,28 @@ namespace ILCompiler
}
else
{
- return new PrecomputedMetadataManager(compilationModuleGroup, context, FindMetadataDescribingModuleInInputSet(inputModules), inputModules, inputMetadataOnlyAssemblies, ReadBytesFromFile(metadataFile), new UtcStackTraceEmissionPolicy());
+ // Set Policies according to passed arguments
+ StackTraceEmissionPolicy stackTraceEmissionPolicy;
+ if (emitStackTraceMetadata)
+ {
+ stackTraceEmissionPolicy = new UtcStackTraceEmissionPolicy();
+ }
+ else
+ {
+ stackTraceEmissionPolicy = new NoStackTraceEmissionPolicy();
+ }
+
+ ManifestResourceBlockingPolicy resourceBlockingPolicy;
+ if (disableExceptionMessages)
+ {
+ resourceBlockingPolicy = new FrameworkStringResourceBlockingPolicy();
+ }
+ else
+ {
+ resourceBlockingPolicy = new NoManifestResourceBlockingPolicy();
+ }
+
+ return new PrecomputedMetadataManager(compilationModuleGroup, context, FindMetadataDescribingModuleInInputSet(inputModules), inputModules, inputMetadataOnlyAssemblies, ReadBytesFromFile(metadataFile), stackTraceEmissionPolicy , resourceBlockingPolicy, disableInvokeThunks);
}
}
@@ -86,11 +107,14 @@ namespace ILCompiler
string outputFile,
UTCNameMangler nameMangler,
bool buildMRT,
+ bool emitStackTraceMetadata,
+ bool disableExceptionMessages,
+ bool allowInvokeThunks,
DictionaryLayoutProvider dictionaryLayoutProvider,
ImportedNodeProvider importedNodeProvider)
: base(context,
compilationModuleGroup,
- PickMetadataManager(context, compilationModuleGroup, inputModules, inputMetadataOnlyAssemblies, metadataFile),
+ PickMetadataManager(context, compilationModuleGroup, inputModules, inputMetadataOnlyAssemblies, metadataFile, emitStackTraceMetadata, disableExceptionMessages, allowInvokeThunks),
NewEmptyInteropStubManager(context, compilationModuleGroup),
nameMangler,
new AttributeDrivenLazyGenericsPolicy(),
@@ -159,6 +183,7 @@ namespace ILCompiler
graph.AddRoot(EagerCctorTable, "EagerCctorTable is always generated");
graph.AddRoot(DispatchMapTable, "DispatchMapTable is always generated");
graph.AddRoot(FrozenSegmentRegion, "FrozenSegmentRegion is always generated");
+ graph.AddRoot(InterfaceDispatchCellSection, "Interface dispatch cell section is always generated");
graph.AddRoot(TypeManagerIndirection, "ModuleManagerIndirection is always generated");
graph.AddRoot(GCStaticsRegion, "GC StaticsRegion is always generated");
graph.AddRoot(GCStaticDescRegion, "GC Static Desc is always generated");
@@ -212,12 +237,21 @@ namespace ILCompiler
{
if (method.HasCustomAttribute("System.Runtime", "RuntimeImportAttribute"))
{
- return new RuntimeImportMethodNode(method);
+ RuntimeImportMethodNode runtimeImportMethod = new RuntimeImportMethodNode(method);
+
+ // If the method is imported from either the current module or the runtime, reference it directly
+ if (CompilationModuleGroup.ContainsMethodBody(method, false))
+ return runtimeImportMethod;
+ // If the method is imported from the runtime but not a managed assembly, reference it directly
+ else if (!CompilationModuleGroup.ImportsMethod(method, false))
+ return runtimeImportMethod;
+
+ // If the method is imported from a managed assembly, reference it via an import cell
}
-
- if (CompilationModuleGroup.ContainsMethodBody(method, false))
+ else
{
- return NonExternMethodSymbol(method, false);
+ if (CompilationModuleGroup.ContainsMethodBody(method, false))
+ return NonExternMethodSymbol(method, false);
}
return _importedNodeProvider.ImportedMethodCodeNode(this, method, false);
@@ -251,16 +285,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;
@@ -348,14 +384,6 @@ namespace ILCompiler
return ReadOnlyDataBlob(NameMangler.GetMangledFieldName(field), ((EcmaField)field).GetFieldRvaData(), Target.PointerSize);
}
- public class UtcDictionaryLayoutProvider : DictionaryLayoutProvider
- {
- public override DictionaryLayoutNode GetLayout(TypeSystemEntity methodOrType)
- {
- return new UtcDictionaryLayoutNode(methodOrType);
- }
- }
-
public ISymbolNode LoopHijackFlagSymbol()
{
return LoopHijackFlag;