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

Limit impact of reflectable Invoke methods #83066

Closed
wants to merge 1 commit into from

Conversation

MichalStrehovsky
Copy link
Member

We need delegate Invoke methods to be reflectable (see #70883), but sometimes we can avoid generating them (and if they're generic, also generating various native layout structures).

Cc @dotnet/ilc-contrib

We need delegate Invoke methods to be reflectable (see dotnet#70883), but sometimes we can avoid generating them (and if they're generic, also generating various native layout structures).
@ghost
Copy link

ghost commented Mar 7, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

We need delegate Invoke methods to be reflectable (see #70883), but sometimes we can avoid generating them (and if they're generic, also generating various native layout structures).

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

bool isActuallyInvokable = !type.IsGenericDefinition;
if (isActuallyInvokable)
{
isActuallyInvokable &= !invokeMethod.Signature.ReturnType.IsByRefLike;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work once #45152 is fixed. POR is to fix that in .NET 8 together with other reflection invoke related functionality and perf issues. cc @steveharter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The good news is that the delegate I was after with this (something with a SpanAction) seems to have disappeared with the other PRs I did around #83069 so this is no longer needed. It would still be a size savings, not an interesting one.

This was only interesting because the SpanAction delegate happened to also have ValueTuple in the signature that calls default equality comparer and brings a ton of stuff into hello world.

@MichalStrehovsky MichalStrehovsky deleted the invokeMethod branch March 7, 2023 08:19
@ghost ghost locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants