Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
7d196a3
Remove verifier element type API and rename primitive-value-type cate…
Copilot May 7, 2026
0af6cad
Rename enum category in cDAC contracts/docs and clean related comments
Copilot May 7, 2026
fbca1de
Address review feedback on enum/primitive category values and comments
Copilot May 7, 2026
2bdd2da
Refine RuntimeHelpers primitive checks after review tool feedback
Copilot May 7, 2026
4a179b3
Clarify primitive/enum mask behavior comment in MethodTable
Copilot May 7, 2026
53d2152
Apply latest enum/primitive review suggestions across runtime and cDAC
Copilot May 7, 2026
6ce3aae
Clarify IsTruePrimitive comment wording in MethodTable
Copilot May 7, 2026
4ec0818
Update src/coreclr/System.Private.CoreLib/src/System/Runtime/Compiler…
jkotas May 7, 2026
f3b8238
Update src/coreclr/System.Private.CoreLib/src/System/Runtime/Compiler…
jkotas May 7, 2026
257cd43
Add IsPrimitive(), refactor SetInternalCorElementType, delete SetIsTr…
Copilot May 7, 2026
ceafd3d
Fix SetFlag type in SetInternalCorElementType default case
Copilot May 7, 2026
1647dbe
Apply suggestion from @jkotas
jkotas May 7, 2026
2a130cb
Apply suggestion from @jkotas
jkotas May 7, 2026
8179e5f
Apply suggestion from @jkotas
jkotas May 7, 2026
9bc8857
Change IsTruePrimitive and IsPrimitive return types from BOOL to bool
Copilot May 7, 2026
22fcaef
Apply MethodTable bool signature and parameter naming suggestions
Copilot May 7, 2026
58de251
Revert category flag names to PrimitiveValueType/TruePrimitive and fi…
Copilot May 7, 2026
492ea1e
Apply suggestion from @jkotas
jkotas May 7, 2026
4b6ba08
Apply suggestion from @jkotas
jkotas May 7, 2026
1e0c510
Apply suggestion from @jkotas
jkotas May 7, 2026
64a71ba
Apply suggestion from @jkotas
jkotas May 7, 2026
e7ac939
Apply suggestions from code review
jkotas May 7, 2026
8d0b204
Apply suggestion from @jkotas
jkotas May 7, 2026
eba9e49
Potential fix for pull request finding
jkotas May 7, 2026
53ca4a8
Apply suggestion from @jkotas
jkotas May 7, 2026
6e6336a
Apply suggestion from @jkotas
jkotas May 7, 2026
5f72765
Apply suggestion from @jkotas
jkotas May 7, 2026
12c5281
Apply suggestion from @jkotas
jkotas May 7, 2026
b7b9de7
Update enum_flag_Category_PrimitiveValueType comment to 'Enum or true…
Copilot May 7, 2026
cf223a5
Update primitive category comments
Copilot May 7, 2026
fe05de3
Rename enum_flag_Category_PrimitiveValueType to enum_flag_Category_En…
Copilot May 7, 2026
99c07d8
Add explanatory comment to IsPrimitive() about ElementTypeMask behavior
Copilot May 7, 2026
8739054
Restore ELEMENT_TYPE_I for runtime handle types without setting categ…
Copilot May 7, 2026
4688e6d
Revert "Restore ELEMENT_TYPE_I for runtime handle types without setti…
Copilot May 7, 2026
25a3420
Fix runtime handle types by setting ELEMENT_TYPE_I with Category_Enum…
Copilot May 7, 2026
ac9f6f6
Revert "Fix runtime handle types by setting ELEMENT_TYPE_I with Categ…
Copilot May 7, 2026
d0a71b8
Fix JIT assertion for runtime handle types by allowing pointer-sized …
Copilot May 7, 2026
51d25a5
Fix runtime handle types by setting ELEMENT_TYPE_VALUETYPE for non-pr…
Copilot May 7, 2026
1e2f63b
Fix runtime handle types by returning CORINFO_TYPE_VALUECLASS from ge…
Copilot May 7, 2026
256d425
Revert assertion relaxation in importer.cpp as the fix in getTypeForP…
Copilot May 7, 2026
7c775d2
Revert getTypeForPrimitiveValueClass change as it causes test failures
Copilot May 7, 2026
8cd4494
Handle runtime handle internal types as TYP_I_IMPL in JIT lvaInitVarDsc
Copilot May 10, 2026
09d4978
Revert "Handle runtime handle internal types as TYP_I_IMPL in JIT lva…
jkotas May 11, 2026
a6e2dbe
Merge branch 'main' into copilot/delete-primitive-value-types
jkotas May 15, 2026
a5c7ff8
More
jkotas May 15, 2026
ffdefa1
More
jkotas May 15, 2026
2cd4088
More
jkotas May 15, 2026
29930e8
Update RuntimeTypeSystem docs to use Category_Enum naming
Copilot May 15, 2026
18c574c
Rename RuntimeTypeSystem doc flag to Category_Primitive
Copilot May 15, 2026
4cc66e2
Rename IsPrimitiveMask constant to ElementTypeMask in RuntimeHelpers
Copilot May 15, 2026
2491a23
Rename Category_Enum to Category_Primitive across runtime flags
Copilot May 15, 2026
361b54f
Merge branch 'main' into copilot/delete-primitive-value-types
jkotas May 15, 2026
90c7b6f
Merge remote-tracking branch 'refs/remotes/origin/main' into copilot/…
Copilot May 18, 2026
2f33264
Handle TypedReference explicitly in ZapSig type comparison
Copilot May 19, 2026
a92c664
Fix CEE_ARGLIST import to produce RuntimeArgumentHandle struct
Copilot May 19, 2026
77b73d1
Fix CEE_ARGLIST to initialize RuntimeArgumentHandle with varargs-hand…
Copilot May 20, 2026
75590e3
Fixes
jkotas May 20, 2026
b7a65ff
Apply suggestion from @jkotas
jkotas May 20, 2026
826c476
Nit
jkotas May 20, 2026
091d2be
Fix build break
jkotas May 20, 2026
8c618c7
Potential fix for pull request finding
jkotas May 20, 2026
6003adb
Apply suggestion from @jkotas
jkotas May 20, 2026
732d054
Delete dead EmitArgIteratorCreateAndLoad helper
Copilot May 21, 2026
b45f413
Add arglist RuntimeArgumentHandle regression test
Copilot May 21, 2026
bb9fd60
Remove stale ArgIterator CTOR2 corelib entry
Copilot May 21, 2026
fadeaed
Delete invalid PREFIX arglist tests
Copilot May 21, 2026
12c1099
Merge branch 'main' into copilot/delete-primitive-value-types
jkotas May 21, 2026
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
16 changes: 6 additions & 10 deletions docs/design/datacontracts/RuntimeTypeSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ internal partial struct RuntimeTypeSystem_1
Category_Array = 0x00080000,
Category_ValueType = 0x00040000,
Category_Nullable = 0x00050000,
Category_PrimitiveValueType = 0x00060000,
Category_Primitive = 0x00060000,
Category_TruePrimitive = 0x00070000,
Category_Interface = 0x000C0000,
Collectible = 0x00200000,
Expand Down Expand Up @@ -837,7 +837,7 @@ Contracts used:
return CorElementType.SzArray;
case WFLAGS_HIGH.Category_ValueType:
case WFLAGS_HIGH.Category_Nullable:
case WFLAGS_HIGH.Category_PrimitiveValueType:
case WFLAGS_HIGH.Category_Primitive:
return CorElementType.ValueType;
case WFLAGS_HIGH.Category_TruePrimitive:
return (CorElementType)GetClassData(typeHandle).InternalCorElementType;
Expand Down Expand Up @@ -872,20 +872,16 @@ Contracts used:
// if typedesc: check for CorElementType.ValueType
}

// Enums have Category_PrimitiveValueType in their MethodTable flags and their
// Enums have Category_Primitive in their MethodTable flags and their
// InternalCorElementType is a primitive type (I1, U1, I2, U2, I4, U4, I8, U8),
// not ValueType. Regular primitive value types (IntPtr/UIntPtr) have Category_TruePrimitive.
// not ValueType. Regular primitive value types (Int32, etc.) have Category_TruePrimitive.
public bool IsEnum(TypeHandle typeHandle)
{
if (!typeHandle.IsMethodTable())
Comment thread
jkotas marked this conversation as resolved.
return false;

CorElementType sigType = GetSignatureCorElementType(typeHandle);
if (sigType != CorElementType.ValueType)
return false;

CorElementType internalType = (CorElementType)GetClassData(typeHandle).InternalCorElementType;
return internalType != CorElementType.ValueType;
MethodTable methodTable = _methodTables[typeHandle.Address];
return methodTable.Flags.GetFlag(WFLAGS_HIGH.Category_Mask) == WFLAGS_HIGH.Category_Primitive;
}

// return true if the TypeHandle represents an array, and set the rank to either 0 (if the type is not an array), or the rank number if it is.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,9 @@ internal unsafe struct MethodTable
private const uint enum_flag_Category_Mask = 0x000F0000;
private const uint enum_flag_Category_ValueType = 0x00040000;
private const uint enum_flag_Category_Nullable = 0x00050000;
private const uint enum_flag_Category_IsPrimitiveMask = 0x000E0000;
private const uint enum_flag_Category_PrimitiveValueType = 0x00060000; // sub-category of ValueType, Enum or primitive value type
private const uint enum_flag_Category_TruePrimitive = 0x00070000; // sub-category of ValueType, Primitive (ELEMENT_TYPE_I, etc.)
private const uint enum_flag_Category_ElementTypeMask = 0x000E0000;
private const uint enum_flag_Category_Primitive = 0x00060000;
private const uint enum_flag_Category_TruePrimitive = 0x00070000;
private const uint enum_flag_Category_Array = 0x00080000;
private const uint enum_flag_Category_Array_Mask = 0x000C0000;
private const uint enum_flag_Category_ValueType_Mask = 0x000C0000;
Expand Down Expand Up @@ -955,7 +955,7 @@ public int MultiDimensionalArrayRank
public bool IsByRefLike => (Flags & (enum_flag_HasComponentSize | enum_flag_IsByRefLike)) == enum_flag_IsByRefLike;

// Warning! UNLIKE the similarly named Reflection api, this method also returns "true" for Enums.
public bool IsPrimitive => (Flags & enum_flag_Category_IsPrimitiveMask) == enum_flag_Category_PrimitiveValueType;
public bool IsPrimitive => (Flags & enum_flag_Category_ElementTypeMask) == enum_flag_Category_Primitive;

public bool IsTruePrimitive => (Flags & enum_flag_Category_Mask) is enum_flag_Category_TruePrimitive;

Expand Down
24 changes: 12 additions & 12 deletions src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -942,12 +942,12 @@ internal sealed class RuntimeMethodInfoStub : IRuntimeMethodInfo
public RuntimeMethodInfoStub(RuntimeMethodHandleInternal methodHandleValue, object keepalive)
{
m_keepalive = keepalive;
m_value = methodHandleValue;
m_value = methodHandleValue.Value;
}

private readonly object m_keepalive;

// These unused variables are used to ensure that this class has the same layout as RuntimeMethodInfo
// These unused variables are used to ensure that m_value has same offset as RuntimeMethodInfo.m_handle
#pragma warning disable CA1823, 414, 169, IDE0044
private object? m_a;
private object? m_b;
Expand All @@ -959,9 +959,9 @@ public RuntimeMethodInfoStub(RuntimeMethodHandleInternal methodHandleValue, obje
private object? m_h;
#pragma warning restore CA1823, 414, 169, IDE0044

public RuntimeMethodHandleInternal m_value;
private IntPtr m_value;

RuntimeMethodHandleInternal IRuntimeMethodInfo.Value => m_value;
RuntimeMethodHandleInternal IRuntimeMethodInfo.Value => new RuntimeMethodHandleInternal(m_value);

// implementation of CORINFO_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD
[StackTraceHidden]
Expand Down Expand Up @@ -1411,28 +1411,28 @@ RuntimeFieldHandleInternal Value
}
}

[StructLayout(LayoutKind.Sequential)]
internal sealed class RuntimeFieldInfoStub : IRuntimeFieldInfo
{
public RuntimeFieldInfoStub(RuntimeFieldHandleInternal fieldHandle, object keepalive)
{
m_keepalive = keepalive;
m_fieldHandle = fieldHandle;
m_fieldHandle = fieldHandle.Value;
}

private readonly object m_keepalive;

// These unused variables are used to ensure that this class has the same layout as RuntimeFieldInfo
#pragma warning disable 414, 169, IDE0044
// These unused variables are used to ensure that m_fieldHandle has same offset as RtFieldInfo.m_fieldHandle
#pragma warning disable CA1823, 414, 169, IDE0044
private IntPtr m_b;
private object? m_c;
private object? m_d;
private int m_b;
private object? m_e;
private object? m_f;
private RuntimeFieldHandleInternal m_fieldHandle;
#pragma warning restore 414, 169, IDE0044
#pragma warning restore CA1823, 414, 169, IDE0044

private IntPtr m_fieldHandle;

RuntimeFieldHandleInternal IRuntimeFieldInfo.Value => m_fieldHandle;
RuntimeFieldHandleInternal IRuntimeFieldInfo.Value => new RuntimeFieldHandleInternal(m_fieldHandle);

// implementation of CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD
[StackTraceHidden]
Expand Down
14 changes: 12 additions & 2 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6991,7 +6991,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
break;

case CEE_ARGLIST:

{
if (!info.compIsVarArgs)
{
BADCODE("arglist in non-vararg method");
Expand All @@ -7002,9 +7002,19 @@ void Compiler::impImportBlockCode(BasicBlock* block)
// The ARGLIST cookie is a hidden 'last' parameter, we have already
// adjusted the arg count cos this is like fetching the last param.
assertImp(numArgs > 0);
op1 = gtNewLclVarAddrNode(lvaVarargsHandleArg, TYP_BYREF);
clsHnd = impGetRuntimeArgumentHandle();

unsigned argListTmp = lvaGrabTemp(false DEBUGARG("arglist tmp"));
lvaSetStruct(argListTmp, clsHnd, false);

op1 = gtNewLclVarAddrNode(lvaVarargsHandleArg, TYP_I_IMPL);
impAppendTree(gtNewStoreLclFldNode(argListTmp, TYP_I_IMPL, 0, op1), CHECK_SPILL_ALL, impCurStmtDI);

op1 = gtNewLclVarNode(argListTmp, TYP_STRUCT);
tiRetVal = makeTypeInfo(clsHnd);
Comment thread
jkotas marked this conversation as resolved.
impPushOnStack(op1, tiRetVal);
break;
}

case CEE_ENDFINALLY:

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arraynative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FCIMPL1(INT32, ArrayNative::GetCorElementTypeOfElementType, ArrayBase* arrayUNSA

_ASSERTE(arrayUNSAFE != NULL);

return arrayUNSAFE->GetArrayElementTypeHandle().GetVerifierCorElementType();
return arrayUNSAFE->GetArrayElementTypeHandle().GetInternalCorElementType();
}
FCIMPLEND

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/callingconvention.h
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ inline BOOL HasRetBuffArgUnmanagedFixup(MetaSig * pSig)
{
WRAPPER_NO_CONTRACT;
// We cannot just pSig->GetReturnType() here since it will return ELEMENT_TYPE_VALUETYPE for enums
CorElementType type = pSig->GetRetTypeHandleThrowing().GetVerifierCorElementType();
CorElementType type = pSig->GetRetTypeHandleThrowing().GetInternalCorElementType();
return type == ELEMENT_TYPE_VALUETYPE;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ void ClassLoader::LoadExactParents(MethodTable* pMT)
/*static*/
CorElementType ClassLoader::GetReducedTypeElementType(TypeHandle hType)
{
CorElementType elemType = hType.GetVerifierCorElementType();
CorElementType elemType = hType.GetInternalCorElementType();
switch (elemType)
{
case ELEMENT_TYPE_U1:
Expand Down
48 changes: 1 addition & 47 deletions src/coreclr/vm/classnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,14 @@
// These system class names are not assembly qualified.

#define g_AppDomainClassName "System.AppDomain"
#define g_ArgIteratorName "ArgIterator"
#define g_ArrayClassName "System.Array"

#define g_NullableName "Nullable`1"

#define g_CollectionsEnumerableItfName "System.Collections.IEnumerable"
#define g_CollectionsEnumeratorClassName "System.Collections.IEnumerator"
#define g_CollectionsCollectionItfName "System.Collections.ICollection"
#define g_CollectionsGenericCollectionItfName "System.Collections.Generic.ICollection`1"
#define g_CollectionsGenericReadOnlyCollectionItfName "System.Collections.Generic.IReadOnlyCollection`1"

#ifdef FEATURE_COMINTEROP
#define g_CorelibAsmName "System.Private.CoreLib"
#define g_SystemAsmName "System"
#define g_SystemRuntimeAsmName "System.Runtime"
#define g_DrawingAsmName "System.Drawing"
#define g_ObjectModelAsmName "System.ObjectModel"
#define g_ColorClassName "System.Drawing.Color"
#define g_ColorTranslatorClassName "System.Drawing.ColorTranslator"
#define g_ComObjectName "__ComObject"
#endif // FEATURE_COMINTEROP

Expand All @@ -55,51 +44,16 @@
#define g_Vector512ClassName "System.Runtime.Intrinsics.Vector512`1"
#define g_Vector512Name "Vector512`1"

#define g_EnumeratorToEnumClassName "System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler"
#define g_ExceptionClassName "System.Exception"
#define g_ExecutionEngineExceptionClassName "System.ExecutionEngineException"

#define g_ThreadStaticAttributeClassName "System.ThreadStaticAttribute"
#define g_TypeIdentifierAttributeClassName "System.Runtime.InteropServices.TypeIdentifierAttribute"

#define g_ObjectClassName "System.Object"
#define g_ObjectName "Object"
#define g_OutOfMemoryExceptionClassName "System.OutOfMemoryException"

#define g_ReflectionClassName "System.RuntimeType"
#define g_ReflectionConstructorName "System.Reflection.RuntimeConstructorInfo"
#define g_ReflectionEventInfoName "System.Reflection.EventInfo"
#define g_ReflectionEventName "System.Reflection.RuntimeEventInfo"
#define g_ReflectionFieldName "System.Reflection.RuntimeFieldInfo"
#define g_ReflectionMemberInfoName "System.Reflection.MemberInfo"
#define g_MethodBaseName "System.Reflection.MethodBase"
#define g_ReflectionFieldInfoName "System.Reflection.FieldInfo"
#define g_ReflectionPropertyInfoName "System.Reflection.PropertyInfo"
#define g_ReflectionConstructorInfoName "System.Reflection.ConstructorInfo"
#define g_ReflectionMethodInfoName "System.Reflection.MethodInfo"
#define g_ReflectionMethodName "System.Reflection.RuntimeMethodInfo"
#define g_ReflectionMethodInterfaceName "System.IRuntimeMethodInfo"
#define g_ReflectionAssemblyName "System.Reflection.RuntimeAssembly"
#define g_ReflectionModuleName "System.Reflection.RuntimeModule"
#define g_ReflectionParamInfoName "System.Reflection.ParameterInfo"
#define g_ReflectionParamName "System.Reflection.RuntimeParameterInfo"
#define g_ReflectionPropInfoName "System.Reflection.RuntimePropertyInfo"
#define g_RuntimeArgumentHandleName "RuntimeArgumentHandle"

#define g_RuntimeFieldHandleClassName "System.RuntimeFieldHandle"
#define g_RuntimeFieldHandleInternalName "RuntimeFieldHandleInternal"
#define g_RuntimeMethodHandleClassName "System.RuntimeMethodHandle"
#define g_RuntimeMethodHandleInternalName "RuntimeMethodHandleInternal"
#define g_RuntimeTypeHandleClassName "System.RuntimeTypeHandle"

#define g_StackOverflowExceptionClassName "System.StackOverflowException"
#define g_StringBufferClassName "System.Text.StringBuilder"
#define g_StringBufferName "StringBuilder"
#define g_StringClassName "System.String"
#define g_StringName "String"

#define g_ThreadClassName "System.Threading.Thread"
#define g_TypeClassName "System.Type"

#define g_VariantClassName "System.Variant"
#define g_GuidClassName "System.Guid"

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/comdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ static bool IsLocationAssignable(TypeHandle fromHandle, TypeHandle toHandle, boo
else
{
// they are not compatible yet enums can go into each other if their underlying element type is the same
if (toHandle.GetVerifierCorElementType() == fromHandle.GetVerifierCorElementType()
if (toHandle.GetInternalCorElementType() == fromHandle.GetInternalCorElementType()
&& (toHandle.IsEnum() || fromHandle.IsEnum()))
return true;

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/comutilnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ FCIMPL1(CorElementType, MethodTableNative::GetPrimitiveCorElementType, MethodTab
{
FCALL_CONTRACT;

_ASSERTE(mt->IsTruePrimitive() || mt->IsEnum());
_ASSERTE(mt->IsPrimitive());

// MethodTable::GetInternalCorElementType has unnecessary overhead for primitives and enums
// Call EEClass::GetInternalCorElementType directly to avoid it
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/vm/corelib.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ DEFINE_METHOD(APPCONTEXT, ON_FIRST_CHANCE_EXCEPTION, OnFirstChanceException,

DEFINE_CLASS(ARG_ITERATOR, System, ArgIterator)
DEFINE_CLASS_U(System, ArgIterator, VARARGS) // Includes a SigPointer.
DEFINE_METHOD(ARG_ITERATOR, CTOR2, .ctor, IM_RuntimeArgumentHandle_PtrVoid_RetVoid)

DEFINE_CLASS(ARGUMENT_HANDLE, System, RuntimeArgumentHandle)

Expand Down Expand Up @@ -206,7 +205,10 @@ DEFINE_CLASS_U(System, RuntimeMethodInfoStub, ReflectMethodO
DEFINE_FIELD_U(m_value, ReflectMethodObject, m_pMD)
DEFINE_CLASS(STUBMETHODINFO, System, RuntimeMethodInfoStub)
DEFINE_FIELD(STUBMETHODINFO, HANDLE, m_value)
DEFINE_METHOD(STUBMETHODINFO, FROMPTR, FromPtr, SM_IntPtr_RetObj)
DEFINE_METHOD(STUBMETHODINFO, FROMPTR, FromPtr, SM_IntPtr_RetObj)
#ifdef FOR_ILLINK
DEFINE_METHOD(STUBMETHODINFO, CTOR, .ctor, IM_RetVoid)
#endif // FOR_ILLINK

DEFINE_CLASS(CONSTRUCTOR_INFO, Reflection, ConstructorInfo)

Expand Down Expand Up @@ -361,12 +363,12 @@ DEFINE_METHOD(TYPE_NAME_RESOLVER, GET_TYPE_HELPER, GetTypeHelper,
DEFINE_CLASS_U(Reflection, RtFieldInfo, NoClass)
DEFINE_FIELD_U(m_fieldHandle, ReflectFieldObject, m_pFD)
DEFINE_CLASS(RT_FIELD_INFO, Reflection, RtFieldInfo)
DEFINE_FIELD(RT_FIELD_INFO, HANDLE, m_fieldHandle)

DEFINE_CLASS_U(System, RuntimeFieldInfoStub, ReflectFieldObject)
DEFINE_FIELD_U(m_fieldHandle, ReflectFieldObject, m_pFD)
DEFINE_CLASS(STUBFIELDINFO, System, RuntimeFieldInfoStub)
DEFINE_METHOD(STUBFIELDINFO, FROMPTR, FromPtr, SM_IntPtr_RetObj)
DEFINE_FIELD(STUBFIELDINFO, HANDLE, m_fieldHandle)
DEFINE_METHOD(STUBFIELDINFO, FROMPTR, FromPtr, SM_IntPtr_RetObj)
#ifdef FOR_ILLINK
DEFINE_METHOD(STUBFIELDINFO, CTOR, .ctor, IM_RetVoid)
#endif // FOR_ILLINK
Expand Down Expand Up @@ -563,8 +565,6 @@ DEFINE_METHOD(RUNTIME_METHOD_BODY, CTOR, .ctor, IM_RetVoid)

DEFINE_CLASS(METHOD_INFO, Reflection, MethodInfo)

DEFINE_CLASS(METHOD_HANDLE_INTERNAL,System, RuntimeMethodHandleInternal)

DEFINE_CLASS(METHOD_HANDLE, System, RuntimeMethodHandle)
DEFINE_FIELD(METHOD_HANDLE, METHOD, m_value)
DEFINE_METHOD(METHOD_HANDLE, TO_INTPTR, ToIntPtr, SM_RuntimeMethodHandle_RetIntPtr)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/customattribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static HRESULT ParseCaType(

if (!th.IsNull() && th.IsEnum())
{
pCaType->enumType = (CorSerializationType)th.GetVerifierCorElementType();
pCaType->enumType = (CorSerializationType)th.GetInternalCorElementType();

// The assembly qualified name of th might not equal pCaType->szEnumName.
// e.g. th could be "MyEnum, MyAssembly, Version=4.0.0.0" while
Expand Down
4 changes: 1 addition & 3 deletions src/coreclr/vm/ilmarshalers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3868,9 +3868,7 @@ bool ILNativeArrayMarshaler::CanMarshalViaPinning()

TypeHandle elementTypeHandle = m_pargs->na.m_pArrayMT->GetArrayElementTypeHandle();

return elementTypeHandle.IsBlittable()
&& (elementTypeHandle.GetMethodTable()->IsValueType()
|| elementTypeHandle.GetMethodTable()->IsTruePrimitive());
return elementTypeHandle.IsBlittable() && elementTypeHandle.GetMethodTable()->IsValueType();
}

void ILNativeArrayMarshaler::EmitMarshalViaPinning(ILCodeStream* pslILEmit)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/ilmarshalers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,7 @@ class ILRuntimeFieldHandleMarshaler : public ILReflectionObjectMarshaler
{
protected:
BinderFieldID GetStructureFieldID() override { LIMITED_METHOD_CONTRACT; return FIELD__FIELD_HANDLE__M_FIELD; }
BinderFieldID GetObjectFieldID() override { LIMITED_METHOD_CONTRACT; return FIELD__RT_FIELD_INFO__HANDLE; }
BinderFieldID GetObjectFieldID() override { LIMITED_METHOD_CONTRACT; return FIELD__STUBFIELDINFO__HANDLE; }
BinderClassID GetManagedTypeBinderID() override { LIMITED_METHOD_CONTRACT; return CLASS__FIELD_HANDLE; }
};

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/invokeutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void InvokeUtil::CopyArg(TypeHandle th, PVOID argRef, ArgDestination *argDest) {
CONTRACTL_END;

void *pArgDst = argDest->GetDestinationAddress();
CorElementType type = th.GetVerifierCorElementType();
CorElementType type = th.GetInternalCorElementType();

switch (type) {
#ifdef TARGET_RISCV64
Expand Down Expand Up @@ -500,7 +500,7 @@ void InvokeUtil::ValidField(TypeHandle th, OBJECTREF* value)
if (th.IsEnum())
COMPlusThrow(kArgumentException,W("Arg_ObjObj"));

type = th.GetVerifierCorElementType();
type = th.GetInternalCorElementType();
if (IsPrimitiveType(type))
{
if (CanPrimitiveWiden(type, oType))
Expand Down
Loading
Loading