You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mono] Add support for SwiftIndirectResult in Mono JIT and Interpreter (#104111)
* Add support for SwiftIndirectResult at P/Invoke boundary
* Update struct lowering
* Introduce arm64 support
* Introduce amd64 support
* Enable runtime tests
* Free RAX if used for the call
* Update src/mono/mono/mini/mini-amd64.c
---------
Co-authored-by: Matous Kozak <[email protected]>
mono_error_set_generic_error (emitted_error, "System", "InvalidProgramException", "Passing non-blittable types to a P/Invoke with the Swift calling convention is unsupported.");
// SwiftSelfand SwiftError are special cases where we need to preserve the class information for the codegen to handle them correctly.
3419
-
if (mono_type_is_struct (ptype) && !(klass==swift_self||klass==swift_error)) {
3419
+
// SwiftSelf, SwiftError, and SwiftIndirectResult are special cases where we need to preserve the class information for the codegen to handle them correctly.
3420
+
if (mono_type_is_struct (ptype) && !(klass==swift_self||klass==swift_error||klass==swift_indirect_result)) {
// SwiftSelfand SwiftError are special cases where we need to preserve the class information for the codegen to handle them correctly.
7547
-
if (mono_type_is_struct (ptype) && !(klass==swift_self||klass==swift_error)) {
7547
+
// SwiftSelf, SwiftError, and SwiftIndirectResult are special cases where we need to preserve the class information for the codegen to handle them correctly.
7548
+
if (mono_type_is_struct (ptype) && !(klass==swift_self||klass==swift_error||klass==swift_indirect_result)) {
// The indirect result is passed in RAX on AMD64. However, since we don't prevent reg allocator to use RAX in m2n wrappers, the RAX is used to pass the function pointer.
1033
+
// We use the R10 register instead and before the native call, the value is moved from R10 to RAX.
0 commit comments