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

Add support for static virtual methods #66084

Merged
merged 1 commit into from
Mar 3, 2022

Conversation

MichalStrehovsky
Copy link
Member

Took the type system changes from #54063 and cleaned them up, added unit tests.

Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing ConstrainedMethodUseLookupResult that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls.

Missing things:

  • Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change.
  • Type loader support. If MakeGeneric needs static virtuals at runtime, it will throw.

But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.

Took the type system changes from dotnet#54063 and cleaned them up, added unit tests.

Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls.

Missing things:

* Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change.
* Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw.

But this is enough to get HttpClient working again. Fixes dotnet#65613. Contributes to dotnet/runtimelab#1665.
Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

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

Looks great to me, thank you!

@MichalStrehovsky MichalStrehovsky merged commit 8dcfacb into dotnet:main Mar 3, 2022
@MichalStrehovsky MichalStrehovsky deleted the staticintf branch March 3, 2022 07:30
@ghost ghost locked as resolved and limited conversation to collaborators Apr 2, 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.

Recent NativeAOT produce warnings about invalid format of DLL
2 participants