Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4284575
Use shared managed thunks for reflection invocation
jkoritzinsky Sep 9, 2026
159f766
Expand shared invocation with bounded reference and primitive shapes
jkoritzinsky Sep 10, 2026
e830840
Document the reference-result TryParse invocation thunk
jkoritzinsky Sep 10, 2026
f37fc61
Document ASP.NET Core callers of specialized invocation shapes
jkoritzinsky Sep 10, 2026
a0db90a
Delay reflection invoke specialization until 10000 calls
jkoritzinsky Sep 10, 2026
ac47d39
Prepare virtual invocation entrypoints on portable runtimes
jkoritzinsky Sep 13, 2026
f0d58a2
Fix NativeAOT invocation roots and constructor argument counts
jkoritzinsky Sep 13, 2026
cb0a26e
Make reflection invocation test instantiations trim-analyzable
jkoritzinsky Sep 14, 2026
00b06d5
Use typed pointer reads in shared reflection thunks
jkoritzinsky Sep 14, 2026
2346fce
Address CCR feedback: exclude P/Invoke and UnmanagedCallersOnly metho…
jkoritzinsky Sep 15, 2026
9f7925e
Tune reflection invoke specialization thresholds
jkoritzinsky Sep 16, 2026
4d7dc9d
Remove InstanceCalliHelper tests
jkoritzinsky Sep 16, 2026
e51260f
Reword the comment and add some asserts
jkoritzinsky Sep 17, 2026
2f974d3
Handle special reflection constructors
jkoritzinsky Sep 17, 2026
fdfe856
Preserve special constructor invoke result
jkoritzinsky Sep 17, 2026
cb282b2
Address CCR feedback: prepare virtual dispatch entrypoint and fix typo
jkoritzinsky Sep 17, 2026
0e4237a
Fix test-only Mono/WASM CI failure: guard MethodBase overloads before…
jkoritzinsky Sep 18, 2026
8bd7e24
Address CCR feedback: drop redundant P/Invoke/UCO and generic-declari…
jkoritzinsky Sep 18, 2026
2ff69a6
Limit special constructor invocation test to CoreCLR
jkoritzinsky Sep 22, 2026
68a8db6
Preserve special constructor invocation behavior
jkoritzinsky Sep 22, 2026
4a3d122
Reject special constructors with existing targets
jkoritzinsky Sep 23, 2026
1c51f17
Use closed generic types in reflection tests
jkoritzinsky Sep 24, 2026
62fbb60
Use closed generic methods in reflection tests
jkoritzinsky Sep 24, 2026
0361781
Allow invoking abstract constructors on existing instances
jkoritzinsky Sep 28, 2026
da89d0b
Fix abstract constructor invocation across invoker paths
jkoritzinsky Sep 29, 2026
b69e73e
Prepare resolved virtual targets
jkoritzinsky Sep 29, 2026
aaabd4d
Track unsupported reflection tests
jkoritzinsky Sep 29, 2026
8720b49
Correct reflection issue mappings
jkoritzinsky Sep 29, 2026
bb9f2f3
Simplify virtual target preparation
jkoritzinsky Sep 30, 2026
3584422
Merge invocation counter, cache declaring type, explain value-type fa…
jkoritzinsky Sep 30, 2026
06250ca
Remove redundant PrepareForUseAsAFunctionPointer call
jkoritzinsky Sep 30, 2026
382f9f8
Cache DeclaringType as RuntimeType and reuse for GetVirtualFunctionPo…
jkoritzinsky Oct 1, 2026
d0e0994
Fix corelib.h column alignment for IntrinsicInvokeHelper entry
jkoritzinsky Oct 1, 2026
94dee58
Remove stale ForceEmitInvoke explanatory comment per jkotas feedback
jkoritzinsky Oct 1, 2026
9942972
Remove redundant EnsureActive call in GetVirtualFunctionPointer
jkoritzinsky Oct 1, 2026
2e30515
Remove unneeded boxed value-type special-case guard in IntrinsicInvok…
jkoritzinsky Oct 1, 2026
1def6ea
Update reflection invoke tests for shared-thunk boxed value-type disp…
jkoritzinsky Oct 1, 2026
bbe6733
Fix condition for dynamic code compilation check
jkoritzinsky Oct 2, 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
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