Activator.CreateInstance supports ByRefLike types#102636
Activator.CreateInstance supports ByRefLike types#102636AaronRobinsonMSFT merged 9 commits intodotnet:mainfrom
Activator.CreateInstance supports ByRefLike types#102636Conversation
This represents an update of Activator.CreateInstance to naturally support byreflike generics. It is modeled off of the current native AOT implementation.
Activator.CreateInstance similar to NAOTActivator.CreateInstance supports byreflike types
Activator.CreateInstance supports byreflike typesActivator.CreateInstance supports ByRefLike types
src/libraries/System.Private.CoreLib/src/System/Activator.RuntimeType.cs
Show resolved
Hide resolved
Wrap invocation in TargetInvocationException.
|
Mono crashes look related. I felt pretty certain just compiling the ctor would return something with the correct calling convention, but perhaps I need to verify that |
|
@AaronRobinsonMSFT please cherrypick lambdageek@c4067c4 The issue was that when using the interpreter there's a second crash in |
On the Mono interpreter, the ldftn opcode for a managed method returns a MonoFtnDesc*, not a native code pointer, and the calli opcode expects a MonoFtnDesc*. The MethodHandle.GetFunctionPointer() function is an interpreter intrinsic that returns such a MonoFtnDesc*
Thanks @lambdageek. I've applied the changes. Let's see if the CI is happy now. |
This represents an update of
Activator.CreateInstanceto naturally support byreflike generics.It is modeled off of the current native AOT implementation.
This now works for all runtimes - CoreCLR, mono and native AOT. Native AOT was a no-op as its implementation was ByRefLike ready.
Contributes to #65112