Open
Description
Based on discussion in: #87924 investigate performance and size impact of enabling
DynamicCodeSupport
feature switch setting, ie:
internal static bool CanEmitObjectArrayDelegate => RuntimeFeature.IsDynamicCodeSupported;;
This means that in AOT mode the property becomes: CanEmitObjectArrayDelegate=false
and in order to support this setting Mono would have to implement a private CoreLib API which:
- creates a strongly typed Delegate (e.g.
Func<int, int>
) that boxes all it's arguments - puts the arguments into an array
- dispatches to a
Func<object?[], object?>
delegate to do the actual work, and finally - unboxes the result
References: comment1 and comment2.
This would also align how System.Linq.Expressions
is supported in other AOT compilers - NativeAOT.