diff --git a/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs b/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs index b1faf0d4130866..0ee508d160c652 100644 --- a/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs +++ b/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs @@ -82,6 +82,13 @@ public static string GetDisplayName(this PropertyPseudoDesc property) .Append('.') .Append(property.Name).ToString(); } + + public static string GetDisplayName(this EventPseudoDesc @event) + { + return new StringBuilder(@event.OwningType.GetDisplayName()) + .Append('.') + .Append(@event.Name).ToString(); + } #endif public static string GetDisplayName(this TypeDesc type) diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs index f445bb1a1fc70b..362fd1763d230d 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs @@ -11,7 +11,7 @@ namespace Internal.TypeSystem /// MetadataFieldLayout algorithm which can be used to compute field layout /// for any MetadataType where all fields are available by calling GetFields. /// - public class MetadataFieldLayoutAlgorithm : FieldLayoutAlgorithm + public abstract class MetadataFieldLayoutAlgorithm : FieldLayoutAlgorithm { public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defType, InstanceLayoutKind layoutKind) { @@ -167,21 +167,7 @@ out instanceByteSizeAndAlignment return ComputeInstanceFieldLayout(type, numInstanceFields); } - protected virtual ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields) - { - if (type.IsExplicitLayout) - { - return ComputeExplicitFieldLayout(type, numInstanceFields); - } - else if (type.IsSequentialLayout || type.IsEnum || type.Context.Target.Abi == TargetAbi.CppCodegen) - { - return ComputeSequentialFieldLayout(type, numInstanceFields); - } - else - { - return ComputeAutoFieldLayout(type, numInstanceFields); - } - } + protected abstract ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields); public override ComputedStaticFieldLayout ComputeStaticFieldLayout(DefType defType, StaticLayoutKind layoutKind) { diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs index d6a351850cd9de..fdd8382a5bdcfa 100644 --- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs @@ -30,5 +30,21 @@ protected override void FinalizeRuntimeSpecificStaticFieldLayout(TypeSystemConte layout.ThreadGcStatics.Size = LayoutInt.Zero; } } + + protected override ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields) + { + if (type.IsExplicitLayout) + { + return ComputeExplicitFieldLayout(type, numInstanceFields); + } + else if (type.IsSequentialLayout || type.IsEnum) + { + return ComputeSequentialFieldLayout(type, numInstanceFields); + } + else + { + return ComputeAutoFieldLayout(type, numInstanceFields); + } + } } } diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 01fd0776225fa6..8cf09e8e96f745 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -287,7 +287,7 @@ - + @@ -633,9 +633,9 @@ - + - + @@ -1113,7 +1113,7 @@ - +