Add CoreCLR implementation of CallConvMemberFunction. (#47828)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Sat, 27 Mar 2021 01:53:10 +0000 (18:53 -0700)
committerGitHub <noreply@github.com>
Sat, 27 Mar 2021 01:53:10 +0000 (01:53 +0000)
commit01d724c1bd1ba9a21a307ee10f881be26f443dd8
treefba29d035aff899bcbf9fa4b7ff3e9755a82ceb4
parentbb25166a1dc4610777d865e735e53783e846e91a
Add CoreCLR implementation of CallConvMemberFunction. (#47828)

* Add CoreCLR implementation of CallConvMemberFunction.

* Add tests and make a few fixes to get them passing.

* Fix Clang build

* Fix argument ordering for calling a cdecl or stdcall instance method from managed.

* Update src/coreclr/dlls/mscorrc/mscorrc.rc

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix UnmanagedCallersOnly instance method calls for stdcall and cdecl.

* Update issues.targets.

* Fix formatting.

* Add dummy param to validate param order. Rewrite traversal to second-to-last argument.

* Merge implementations of call conv modopt name comparison.

Use a macro-based implementation initially since it allows us to add new calling conventions by adding one line and the macro-ized code is relatively small.

* Fix assignment alignment.

* SAL and contracts.

* Add assert

* Fix UnmanagedCallersOnly parsing in the refactored parser.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
29 files changed:
src/coreclr/dlls/mscorrc/mscorrc.rc
src/coreclr/inc/corhdr.h
src/coreclr/inc/corinfo.h
src/coreclr/jit/importer.cpp
src/coreclr/jit/lclvars.cpp
src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
src/coreclr/vm/corelib.h
src/coreclr/vm/dllimport.cpp
src/coreclr/vm/dllimportcallback.cpp
src/coreclr/vm/siginfo.cpp
src/coreclr/vm/siginfo.hpp
src/coreclr/vm/stubgen.cpp
src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/CallingConventions.cs
src/libraries/System.Runtime/ref/System.Runtime.cs
src/tests/Common/Platform/platformdefines.h
src/tests/Interop/CMakeLists.txt
src/tests/Interop/PInvoke/Miscellaneous/ThisCall/CMakeLists.txt [deleted file]
src/tests/JIT/Directed/callconv/CMakeLists.txt [new file with mode: 0644]
src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.cs [new file with mode: 0644]
src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.csproj [new file with mode: 0644]
src/tests/JIT/Directed/callconv/InstanceCallConvTest.cpp [moved from src/tests/Interop/PInvoke/Miscellaneous/ThisCall/ThisCallNative.cpp with 76% similarity]
src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.cs [new file with mode: 0644]
src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.csproj [new file with mode: 0644]
src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.cs [new file with mode: 0644]
src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.csproj [new file with mode: 0644]
src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.cs [moved from src/tests/Interop/PInvoke/Miscellaneous/ThisCall/ThisCallTest.cs with 97% similarity]
src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.csproj [moved from src/tests/Interop/PInvoke/Miscellaneous/ThisCall/ThisCallTest.csproj with 54% similarity]
src/tests/issues.targets