diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
index 78141e32f0fa66..f2254ea4f22873 100644
--- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -172,6 +172,7 @@
+
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs
index aa351553b79966..6cf00e6edab4f3 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs
@@ -1,23 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Diagnostics.CodeAnalysis;
-
namespace System.Reflection
{
public partial class ConstructorInvoker
{
- private readonly Signature? _signature;
+ private IntrinsicInvokeHelper.InvokeState _invokeState;
internal unsafe ConstructorInvoker(RuntimeConstructorInfo constructor) : this(constructor, constructor.Signature.Arguments)
{
- _signature = constructor.Signature;
- _invokeFunc_RefArgs = InterpretedInvoke;
+ _invokeFunc_RefArgs = InvokeWithSharedThunk;
}
- private unsafe object? InterpretedInvoke(object? obj, IntPtr* args)
- {
- return RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null);
- }
+ private unsafe object? InvokeWithSharedThunk(object? obj, IntPtr* args) =>
+ IntrinsicInvokeHelper.Invoke(ref _invokeState, ref _strategy, ref _invokeFunc_RefArgs,
+ _method, _argTypes, obj, args, backwardsCompat: false);
}
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs
index 08758cdf75d59f..0e16149b224058 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs
@@ -156,6 +156,62 @@ internal static void Call(delegate*