-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Update SPCL to use GeneratedDllImport where possible. #61640
Update SPCL to use GeneratedDllImport where possible. #61640
Conversation
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.
Can you make sure to run the code-fix on the other target OSes of System.Private.CoreLib as well so we can catch the Linux and MacOS P/Invokes too? I think if you set the TargetOS environment variable before opening VS, you'll be able to override the target OS. Or you can change
Line 21 in 25da88c
<TargetOS Condition="'$(TargetOS)' == ''">$(_hostOS)</TargetOS> |
What remains that's not possible? Do we have a plan to get to 100%, whether by improving the source generator or by changing the P/Invoke signatures or both? |
@stephentoub The biggest change is the blittable signatures with |
This also doesn't include converting QCalls. Now that @jkoritzinsky has updated how the runtime handles QCalls, we should be able to do another pass over SPCL to convert those as well. There are also a couple of other things like |
Thanks.
But we should be able to update any use of those to not need them, right (or decide to update GeneratedDllImport to support them)? I'm just trying to nudge us to a place where a) we've proven that GeneratedDllImport reasonably can be used exclusively instead of DllImport (using our vast numbers of DllImports in dotnet/runtime as a proxy for real-world usage) and b) we ship .NET 7 without having to generate any stubs at run-time. |
arm64 regressions (since fixed): |
Improvements on windows-arm64: dotnet/perf-autofiling-issues#2555 |
/cc @jkoritzinsky @elinor-fung