-
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
switch to using CSTRMarshaller instead of AnsiBSTR #55032
Conversation
|
||
bool bPassByValueInOnly = In && !Out && !IsManagedByRef; | ||
ILLocalVariable localBuffer = emitter.NewLocal(Context.GetWellKnownType(WellKnownType.IntPtr)); | ||
if (bPassByValueInOnly) |
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.
is there a reason why this logic cant move to System.StubHelpers.CSTRMarshaler
?
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.
Yes, it would be nice to have majority of the logic in C#, and minimize amount of the hand-emitted IL.
@AaronRobinsonMSFT as well.. perhaps we should just fix the |
Updated the cleanup logic to the one implemented in ILOptimizedAllocMarshaler::EmitClearNative
crossgen2 outerloop failures are comparable to main runs. |
Do we need a regression test? |
yeah I am hoping there are some interop tests already covering |
We have a lot of tests for this. The problem is that the interop stub generation in crossgen is currently only enabled for CoreLib, so it is impossible to test. We would need to enable it for everything in CoreLib version bubble to make it testable by changing this to |
which is being done in this PR: #54847? So a combination of the two PRs (without skipping |
Yes, assuming we have appropriate large version bubble test leg. |
with the latest change I am hitting an issue similar to this: #51189. so more of these marshallers would need updates to work with R2R |
I would recommend undoing the last change, and deal with the testing later. We need a unified intentionally designed set of helpers for marshalling strings that are shared between runtime-generated, crossgen-generated and source-generated interop. |
yeah that seems like the best approach to get this merged. Will revert that change. |
This reverts commit 8575306.
ok, CI is good now. crossgen2-composite failures are at par with main. |
Btw, disabling the Utf8Marshaller would be as simple as deleting these two lines: runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Interop/IL/Marshaller.ReadyToRun.cs Lines 28 to 29 in d431d6a
Looks like all of this slipped through the cracks because nobody realized it's pretty much not exercised by anything. |
yeah will do that as a separate change. Believe there are other ones (like |
Any other concerns with this? |
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.
Looks good otherwise.
Fixes #54820.
cc @dotnet/crossgen-contrib @MichalStrehovsky