Skip to content

Delete DelegateInvokeThunk - #72903

Merged
MichalStrehovsky merged 2 commits into
dotnet:mainfrom
jkotas:reflection-prepwork
Jul 27, 2022
Merged

MichalStrehovsky merged 2 commits into
dotnet:mainfrom
jkotas:reflection-prepwork

Conversation

@jkotas

@jkotas jkotas commented Jul 27, 2022

Copy link
Copy Markdown
Member
  • DelegateInvokeThunk used by Delegate.DynamicInvoke was redundant with delegate Invoke method that is always preserved for delegates. The implementation of the DelegateInvokeThunk was even piggy backing on the delegate Invoke method for default parameter values.
  • Add generic cache for per-type scenario specific data. Switched over Enum info to use it (same as CoreCLR), and leverage it for caching of the dynamic delegate info.
  • nullability annotation fixes

This is prep-work for #72548

- DelegateInvokeThunk used by Delegate.DynamicInvoke was redundant with delegate Invoke method that is always preserved for delegates. The implementation of the DelegateInvokeThunk was even piggy backing on the delegate Invoke method for default parameter values.
- Add generic cache for per-type scenario specific data. Switched over Enum info to use it (same as CoreCLR), and leverage it for caching of the dynamic delegate info.
- nullability annotation fixes

This is prep-work for dotnet#72548

@MichalStrehovsky MichalStrehovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for simplifying this!


ILCodeLabel returnNullLabel = emitter.NewCodeLabel();

bool hasDynamicInvokeThunk = (_delegateInfo.SupportedFeatures & DelegateFeature.DynamicInvoke) != 0 &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we delete DelegateFeature.DynamicInvoke?

@MichalStrehovsky
MichalStrehovsky merged commit c4a8c8a into dotnet:main Jul 27, 2022
@jkotas
jkotas deleted the reflection-prepwork branch July 28, 2022 19:30
@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2022
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