Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3126bd3

Browse files
authored
Mark legacy ByRef-like types as ref in sources (#15846)
Delete special casing in the type loader
1 parent 19cdca1 commit 3126bd3

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

src/mscorlib/src/System/ArgIterator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace System
1313
// Note: This type must have the same layout as the CLR's VARARGS type in CLRVarArgs.h.
1414
// It also contains an inline SigPointer data structure - must keep those fields in sync.
1515
[StructLayout(LayoutKind.Sequential)]
16-
public struct ArgIterator
16+
public ref struct ArgIterator
1717
{
1818
private IntPtr ArgCookie; // Cookie from the EE.
1919

src/mscorlib/src/System/RuntimeArgumentHandle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace System
1515
// This corresponds to EE VARARGS cookie.
1616

1717
// Cannot be serialized
18-
public struct RuntimeArgumentHandle
18+
public ref struct RuntimeArgumentHandle
1919
{
2020
private IntPtr m_ptr;
2121

src/mscorlib/src/System/TypedReference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace System
1616

1717
[CLSCompliant(false)]
1818
[System.Runtime.Versioning.NonVersionable] // This only applies to field layout
19-
public struct TypedReference
19+
public ref struct TypedReference
2020
{
2121
private IntPtr Value;
2222
private IntPtr Type;

src/vm/methodtablebuilder.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9585,11 +9585,6 @@ void MethodTableBuilder::CheckForSystemTypes()
95859585
}
95869586
LOG((LF_CLASSLOADER, LL_INFO10000, "%s::%s marked as primitive type %i\n", nameSpace, name, type));
95879587
#endif // _DEBUG
9588-
9589-
if (type == ELEMENT_TYPE_TYPEDBYREF)
9590-
{
9591-
pMT->SetIsByRefLike();
9592-
}
95939588
}
95949589
else if (strcmp(name, g_NullableName) == 0)
95959590
{
@@ -9606,19 +9601,11 @@ void MethodTableBuilder::CheckForSystemTypes()
96069601
pMT->SetInternalCorElementType(ELEMENT_TYPE_VALUETYPE);
96079602
}
96089603
#endif
9609-
else if (strcmp(name, g_ArgIteratorName) == 0)
9610-
{
9611-
// Mark the special types that have embeded stack pointers in them
9612-
pMT->SetIsByRefLike();
9613-
}
9604+
#ifndef _TARGET_X86_
96149605
else if (strcmp(name, g_RuntimeArgumentHandleName) == 0)
96159606
{
9616-
pMT->SetIsByRefLike();
9617-
#ifndef _TARGET_X86_
96189607
pMT->SetInternalCorElementType (ELEMENT_TYPE_I);
9619-
#endif
96209608
}
9621-
#ifndef _TARGET_X86_
96229609
else if (strcmp(name, g_RuntimeMethodHandleInternalName) == 0)
96239610
{
96249611
pMT->SetInternalCorElementType (ELEMENT_TYPE_I);

0 commit comments

Comments
 (0)