-
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
JIT: Sign/zero-extend small primitive arguments for pinvokes on arm32 and Apple arm64 #106314
Conversation
… and Apple arm64 Fix dotnet#101046
@@ -293,14 +293,11 @@ typedef uint8_t CODE_LOCATION; | |||
|
|||
typedef bool CLR_BOOL; |
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.
Delete?
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 like it's still used as the return value for HandleTableRestrictedCallbackFunction
.
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.
And TryGetTaggedMemoryCallback.
These correspond to the following managed methods:
Lines 428 to 434 in 37284fc
[UnmanagedCallersOnly] private static bool IsRootedCallback(IntPtr pObj) { // We are paused in the GC, so this is safe. ManagedObjectWrapperHolder* holder = (ManagedObjectWrapperHolder*)&pObj; return holder->_wrapper->IsRooted; } Lines 58 to 59 in b1968e7
[RuntimeExport("ObjectiveCMarshalTryGetTaggedMemory")] private static bool TryGetTaggedMemory(IntPtr pObj, IntPtr* tagged)
CLR_BOOL
is not quite right for neither of these, but I do not think that this mismatch is going to cause any real problem. It would be nice to clean this up in a follow up.
This reverts commit 084f970.
@AndyAyersMS, PTAL. This is for RC1 snap. |
cc @dotnet/jit-contrib PTAL @AndyAyersMS @jkotas |
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.
Jit changes LGTM.
@@ -1335,7 +1335,10 @@ typedef UINT32 FC_UINT8_RET; | |||
typedef INT32 FC_INT16_RET; | |||
typedef UINT32 FC_UINT16_RET; | |||
|
|||
// Small primitive args are not widened. |
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.
The comment around line 150 in this file still mentions CLR_BOOL.
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.
Mind if I update that in a separate change tomorrow?
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.
Fine with me
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.
Nevermind, updated it as well now due to those other places I missed the conversion.
These places are missing the
|
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.
LGTM otherwise. Thanks!
cc @carlossanlop to include this in RC1 snap if CI tests pass. |
Thanks. I'm aware, it's in my list of PRs to wait. @jakobbotsch reached out earlier. |
The runtime pipeline is done (some of the jobs didn't have their status updates, presumably because of the outage). Build analysis is happy. We can skip waiting for the superpmi jobs – they were green in the previous run and there hasn't been any JIT changes since then. |
Fix #101046
Alternative to #106312 that keeps the behavior as is for the managed calling convention and only changes it for pinvokes. This requires changing fcalls in the VM to access small primitive typed arguments without assumptions about normalization.