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/CompilerMetadataFieldLayoutAlgorithm.cs')
-rw-r--r--src/ILCompiler.Compiler/src/Compiler/CompilerMetadataFieldLayoutAlgorithm.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/CompilerMetadataFieldLayoutAlgorithm.cs b/src/ILCompiler.Compiler/src/Compiler/CompilerMetadataFieldLayoutAlgorithm.cs
index 1d6d2c870..48daeab70 100644
--- a/src/ILCompiler.Compiler/src/Compiler/CompilerMetadataFieldLayoutAlgorithm.cs
+++ b/src/ILCompiler.Compiler/src/Compiler/CompilerMetadataFieldLayoutAlgorithm.cs
@@ -7,6 +7,8 @@ using System.Collections.Generic;
using Internal.TypeSystem;
+using Debug = System.Diagnostics.Debug;
+
namespace ILCompiler
{
internal class CompilerMetadataFieldLayoutAlgorithm : MetadataFieldLayoutAlgorithm
@@ -15,7 +17,7 @@ namespace ILCompiler
{
// GC statics start with a pointer to the "EEType" that signals the size and GCDesc to the GC
layout.GcStatics.Size = context.Target.LayoutPointerSize;
- layout.ThreadStatics.Size = context.Target.LayoutPointerSize;
+ layout.ThreadGcStatics.Size = context.Target.LayoutPointerSize;
}
protected override void FinalizeRuntimeSpecificStaticFieldLayout(TypeSystemContext context, ref ComputedStaticFieldLayout layout)
@@ -26,10 +28,14 @@ namespace ILCompiler
{
layout.GcStatics.Size = LayoutInt.Zero;
}
- if (layout.ThreadStatics.Size == context.Target.LayoutPointerSize)
+ if (layout.ThreadGcStatics.Size == context.Target.LayoutPointerSize)
{
- layout.ThreadStatics.Size = LayoutInt.Zero;
+ layout.ThreadGcStatics.Size = LayoutInt.Zero;
}
+
+ // CoreRT makes no distinction between Gc / non-Gc thread statics. All are placed into ThreadGcStatics since thread statics
+ // are typically rare.
+ Debug.Assert(layout.ThreadNonGcStatics.Size == LayoutInt.Zero);
}
}
}