Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono] Investigate enabling CanEmitObjectArrayDelegate to respect DynamicCodeSupport feature switch in System.Linq.Expressions library #90092

Open
ivanpovazan opened this issue Aug 7, 2023 · 0 comments

Comments

@ivanpovazan
Copy link
Member

ivanpovazan commented Aug 7, 2023

Based on discussion in: #87924 investigate performance and size impact of enabling

internal static bool CanEmitObjectArrayDelegate => true;
to respect 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.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 7, 2023
@ivanpovazan ivanpovazan changed the title [mono] Investigate enabling to respect [mono] Investigate enabling CanEmitObjectArrayDelegate to respect IsDynamicCodeSupported=false Aug 7, 2023
@ivanpovazan ivanpovazan self-assigned this Aug 7, 2023
@ivanpovazan ivanpovazan added feature-request and removed untriaged New issue has not been triaged by the area owner labels Aug 7, 2023
@ivanpovazan ivanpovazan added this to the Future milestone Aug 7, 2023
@ivanpovazan ivanpovazan changed the title [mono] Investigate enabling CanEmitObjectArrayDelegate to respect IsDynamicCodeSupported=false [mono] Investigate enabling CanEmitObjectArrayDelegate to respect DynamicCodeSupport feature switch in System.Linq.Expressions library Aug 7, 2023
@ivanpovazan ivanpovazan changed the title [mono] Investigate enabling CanEmitObjectArrayDelegate to respect DynamicCodeSupport feature switch in System.Linq.Expressions library [mono] Investigate enabling CanEmitObjectArrayDelegate to respect DynamicCodeSupport feature switch in System.Linq.Expressions library Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant