-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
area-VM-reflection-monoReflection issues specific to MonoVMReflection issues specific to MonoVM
Milestone
Description
Per this issue and comment here's the Mono work necessary to support the IL Emit fast-path. This effort will also be used to support the planned new Invoke() APIs to support byref-like types.
Native changes
In RuntimeMethodInfo.InternalInvoke, apply the same changes as made to CoreClr's RuntimeMethodHandle::Invoke including:
- Pass parameters byref instead of by
System.Object. This primarily means value types are no longer required to be boxed; this will be leveraged more when we support byref-like types later. Also, when we do that the return value andobjparameter will also need to be changed to be byref or useTypedReferencepending design. - All conversions removed such as from Int to Long (moved to managed).
- No exception handling for
TargetInvocationException(moved to managed). Also see the breaking change issue.- A
nullbyref for a byref-like parameter should just throw now instead of passingdefault(). - Invalid ctor parameters for size should just throw wrapped in TIE instead of outside the TIE.
- See Update runtime Invoke exception handling #67457
- A
Nullable<T>is now passed as a trueNullable<T>, not as a boxedTornull.
Managed changes
- Change the various Invoker and shared invoke code to remove Mono special casing.
- Search for
// Temporary until Mono is updatedand remove the corresponding#ifs. - In the Method and Constructor invoker classes, Mono should use the same exception handling as Core which is basically
try\catch(Exception)without any one-off catches for misc exception types.
- Search for
- Update
RuntimeType.CheckValue()(see the Core implementation)- Perform validation and conversions that were probably handled in native code before; Core added
InvokeUtils.ConvertOrWidenwhich should be able to be re-used. - Add special
Nullable<T>calls to create true nullables (see the Core implementation)
- Perform validation and conversions that were probably handled in native code before; Core added
lambdageek and SamMonoRT
Metadata
Metadata
Assignees
Labels
area-VM-reflection-monoReflection issues specific to MonoVMReflection issues specific to MonoVM