-
Notifications
You must be signed in to change notification settings - Fork 5k
Add internal intrinsics for instance-based calli #114495
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
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection-emit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.
Files not reviewed (2)
- src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj: Language not supported
- src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj: Language not supported
src/libraries/System.Runtime/tests/System.Reflection.Tests/MethodCommonTests.cs
Outdated
Show resolved
Hide resolved
Wouldn't it be simpler to just write those stubs in IL instead of having to implement them in every VM? |
We would need to invent build infrastructure to merge this IL into CoreLib.... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT otherwise. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/ba-g infra timeout on building Libraries Test Run release coreclr linux_musl x64 Debug |
Contributes to #112994. The next step in this process will use these intrinsics.
Adds support for both CoreClr JIT and R2R to modify the function pointer signature to add HasThis | ExplicitThis so specific function pointer signatures can be called on an instance method.
Local testing verified both:
The tests added here currently don't verify the intrinsics, but an earlier version did (see the first commit). Once the next step of hooking into reflection is done, these tests will cover the new intrinsics added here. In particular, the new tests address missing test cases of calling an instance-based method with non-primitive return types such as
Guid
,DateTime
andTimeSpan
that would fail if reflection called these methods with function pointers \ Calli without HasThis | ExplicitThis.