diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Activator.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Activator.NativeAot.cs index a3b69bf6f52f69..ab710ed580453f 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Activator.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Activator.NativeAot.cs @@ -49,7 +49,7 @@ public static partial class Activator try { // Call the default constructor on the allocated instance. - if (RuntimeHelpers.IsReference()) + if (!typeof(T).IsValueType) { // Grab a pointer to the optimized allocator for the type and call it. IntPtr allocator = AllocatorOf(); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs index 11025b83e0f706..2981b35f520734 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.NativeAot.cs @@ -179,12 +179,6 @@ public static unsafe bool TryEnsureSufficientExecutionStack() return (t_sufficientStackLimit = limit); } - [Intrinsic] - internal static unsafe bool IsReference() - { - return !MethodTable.Of()->IsValueType; - } - [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static bool IsBitwiseEquatable() diff --git a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs index ebfdf6308fefd5..ad0670d36f7e94 100644 --- a/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs +++ b/src/coreclr/tools/Common/TypeSystem/IL/Stubs/RuntimeHelpersIntrinsics.cs @@ -30,11 +30,7 @@ public static MethodIL EmitIL(MethodDesc method) return null; bool result; - if (methodName == "IsReference") - { - result = elementType.IsGCPointer; - } - else if (methodName == "IsBitwiseEquatable") + if (methodName == "IsBitwiseEquatable") { // Ideally we could detect automatically whether a type is trivially equatable // (i.e., its operator == could be implemented via memcmp). But for now we'll