Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\SymbolMethod.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\FieldInfo.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\InstanceCalliHelper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\IntrinsicInvokeHelper.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\LoaderAllocator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MdConstant.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MdFieldInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,62 @@ internal static void Call(delegate*<object, object?, object?, object?, object?,
internal static void Call(delegate*<object, object?, object?, object?, object?, object?, object?, void> fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6)
=> fn(o, arg1, arg2, arg3, arg4, arg5, arg6);

[Intrinsic]
internal static void Call(delegate*<object, object?, object?, object?, object?, object?, object?, object?, void> fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7)
=> fn(o, arg1, arg2, arg3, arg4, arg5, arg6, arg7);

[Intrinsic]
internal static void Call(delegate*<object, object?, object?, object?, object?, object?, object?, object?, object?, void> fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6, object? arg7, object? arg8)
=> fn(o, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);

[Intrinsic]
internal static object? Call(delegate*<object, object?, object?> fn, object o, object? arg1)
=> fn(o, arg1);

[Intrinsic]
internal static object? Call(delegate*<object, object?, object?, object?> fn, object o, object? arg1, object? arg2)
=> fn(o, arg1, arg2);

[Intrinsic]
internal static object? Call(delegate*<object, object?, object?, object?, object?> fn, object o, object? arg1, object? arg2, object? arg3)
=> fn(o, arg1, arg2, arg3);

[Intrinsic]
internal static object? Call(delegate*<object, object?, object?, object?, object?, object?> fn, object o, object? arg1, object? arg2, object? arg3, object? arg4)
=> fn(o, arg1, arg2, arg3, arg4);

[Intrinsic]
internal static int Call(delegate*<object, object?, object?, int> fn, object o, object? arg1, object? arg2)
=> fn(o, arg1, arg2);

[Intrinsic]
internal static void Call(delegate*<object, int, int, void> fn, object o, int arg1, int arg2)
=> fn(o, arg1, arg2);

[Intrinsic]
internal static void Call(delegate*<object, long, long, void> fn, object o, long arg1, long arg2)
=> fn(o, arg1, arg2);

[Intrinsic]
internal static void Call(delegate*<object, object?, int, void> fn, object o, object? arg1, int arg2)
=> fn(o, arg1, arg2);

[Intrinsic]
internal static void Call(delegate*<object, object?, int, object?, object?, void> fn, object o, object? arg1, int arg2, object? arg3, object? arg4)
=> fn(o, arg1, arg2, arg3, arg4);

[Intrinsic]
internal static void Call(delegate*<object, object?, object?, bool, object?, void> fn, object o, object? arg1, object? arg2, bool arg3, object? arg4)
=> fn(o, arg1, arg2, arg3, arg4);

[Intrinsic]
internal static void Call(delegate*<object, object?, object?, object?, bool, object?, void> fn, object o, object? arg1, object? arg2, object? arg3, bool arg4, object? arg5)
=> fn(o, arg1, arg2, arg3, arg4, arg5);

[Intrinsic]
internal static void Call(delegate*<object, float, float, float, int, void> fn, object o, float arg1, float arg2, float arg3, int arg4)
=> fn(o, arg1, arg2, arg3, arg4);

[Intrinsic]
internal static void Call(delegate*<object, IEnumerable<object>?, void> fn, object o, IEnumerable<object>? arg1)
=> fn(o, arg1);
Expand Down
Loading
Loading