Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Sigh"
This reverts commit a706a05.
  • Loading branch information
MichalStrehovsky committed Nov 18, 2021
commit c4b74ba79ab47f5f295d7b3b5f76869e47cb5598
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ protected internal virtual TypeDesc ConvertToCanon(TypeDesc typeToConvert, Canon
throw new NotSupportedException();
}

internal partial void InternalGetSupportsUniversalCanon(ref bool flag) => flag = SupportsUniversalCanon;
public abstract bool SupportsCanon { get; }
public abstract bool SupportsUniversalCanon { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,13 @@ out instanceByteSizeAndAlignment

protected virtual ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields)
{
bool supportsUniversalCanon = false;
type.Context.InternalGetSupportsUniversalCanon(ref supportsUniversalCanon);

if (type.IsExplicitLayout)
{
return ComputeExplicitFieldLayout(type, numInstanceFields);
}
// Sequential layout has to be respected for blittable types only. We use approximation and respect it for
// all types without GC references (ie C# unmanaged types). Universal canonical instances might be blittable.
else if (type.IsSequentialLayout && (supportsUniversalCanon || !type.ContainsGCPointers))
else if (type.IsSequentialLayout && (type.Context.SupportsUniversalCanon || !type.ContainsGCPointers))
{
return ComputeSequentialFieldLayout(type, numInstanceFields);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,5 @@ internal TypeFlags ComputeTypeFlags(TypeDesc type, TypeFlags flags, TypeFlags ma
/// Determine if the type implements <code>IDynamicInterfaceCastable</code>
/// </summary>
protected internal abstract bool IsIDynamicInterfaceCastableInterface(DefType type);

internal partial void InternalGetSupportsUniversalCanon(ref bool flag);
}
}