-
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
Changes from all commits
139ef35
d23d18a
0f36593
e31819b
e48bad1
f685cf6
084f970
2f6ab23
69c1db3
f379379
9f9fcb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,7 +151,7 @@ | |
// Also, initialize all the OBJECTREF's first. Like this: | ||
// | ||
// FCIMPL4(Object*, COMNlsInfo::nativeChangeCaseString, LocaleIDObject* localeUNSAFE, | ||
// INT_PTR pNativeTextInfo, StringObject* pStringUNSAFE, CLR_BOOL bIsToUpper) | ||
// INT_PTR pNativeTextInfo, StringObject* pStringUNSAFE, FC_BOOL_ARG bIsToUpper) | ||
// { | ||
// [ignoring CONTRACT for now] | ||
// struct _gc | ||
|
@@ -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 commentThe 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 commentThe 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 commentThe 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 commentThe 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. |
||
typedef INT32 FC_BOOL_ARG; | ||
|
||
#define FC_ACCESS_BOOL(x) ((BYTE)x != 0) | ||
|
||
// The fcall entrypoints has to be at unique addresses. Use this helper macro to make | ||
// the code of the fcalls unique if you get assert in ecall.cpp that mentions it. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
include_directories(${INC_PLATFORM_DIR}) | ||
|
||
# This test always needs to be optimized to hit the problem. | ||
set(CMAKE_BUILD_TYPE Release) | ||
|
||
add_library(Runtime101046Native SHARED Runtime_101046.cpp) | ||
target_link_libraries(Runtime101046Native PRIVATE platformdefines) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#include <platformdefines.h> | ||
#include <stdint.h> | ||
|
||
extern "C" DLL_EXPORT int32_t ReturnExtendedShort(int16_t s) | ||
{ | ||
return s; | ||
} |
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:
runtime/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs
Lines 428 to 434 in 37284fc
runtime/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.NativeAot.cs
Lines 58 to 59 in b1968e7
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.