You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 and obj parameter will also need to be changed to be byref or use TypedReference pending 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 null byref for a byref-like parameter should just throw now instead of passing default().
Invalid ctor parameters for size should just throw wrapped in TIE instead of outside the TIE.
Nullable<T> is now passed as a true Nullable<T>, not as a boxed T or null.
Managed changes
Change the various Invoker and shared invoke code to remove Mono special casing.
Search for // Temporary until Mono is updated and 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.
Update RuntimeType.CheckValue() (see the Core implementation)
Perform validation and conversions that were probably handled in native code before; Core added InvokeUtils.ConvertOrWiden which should be able to be re-used.
Add special Nullable<T> calls to create true nullables (see the Core implementation)
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'sRuntimeMethodHandle::Invokeincluding: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.TargetInvocationException(moved to managed). Also see the breaking change issue.nullbyref for a byref-like parameter should just throw now instead of passingdefault().Nullable<T>is now passed as a trueNullable<T>, not as a boxedTornull.Managed changes
// Temporary until Mono is updatedand remove the corresponding#ifs.try\catch(Exception)without any one-off catches for misc exception types.RuntimeType.CheckValue()(see the Core implementation)InvokeUtils.ConvertOrWidenwhich should be able to be re-used.Nullable<T>calls to create true nullables (see the Core implementation)