diff --git a/proposed/swift-interop.md b/proposed/swift-interop.md index e0f764cdc..ab16bf9ee 100644 --- a/proposed/swift-interop.md +++ b/proposed/swift-interop.md @@ -80,7 +80,7 @@ We have selected an approach for handling the error register in the Swift callin 1. Use a special type named something like `SwiftError*` to indicate the error parameter -This approach expresses that the to-be-called Swift function uses the Error Register in the signature and they both require signature manipulation in the JIT/AOT compilers. Like with `SwiftSelf`, we would throw an `InvalidProgramException` for a signature with multiple `SwiftError` parameters. We use a pointer-to-`SwiftError` type to indicate that the error register is a by-ref/out parameter. We don't use managed pointers as our modern JITs can reason about unmanaged pointers well enough that we do not end up losing any performance taking this route. The `UnmanagedCallersOnly` implementation will require a decent amount of JIT work to emulate a local variable for the register value, but we have prior art in the Clang implementation of the Swift error register that we can fall back on. Delegates annotated with `UnmanagedCallersOnly` will store the `SwiftError*` value in the error register in their epilog. +This approach expresses that the to-be-called Swift function uses the Error Register in the signature and they both require signature manipulation in the JIT/AOT compilers. Like with `SwiftSelf`, we would throw an `InvalidProgramException` for a signature with multiple `SwiftError` parameters. We use a pointer-to-`SwiftError` type to indicate that the error register is a by-ref/out parameter. We don't use managed pointers as our modern JITs can reason about unmanaged pointers well enough that we do not end up losing any performance taking this route. The `UnmanagedCallersOnly` implementation will require a decent amount of JIT work to emulate a local variable for the register value, but we have prior art in the Clang implementation of the Swift error register that we can fall back on. Methods annotated with `UnmanagedCallersOnly` will pass the `SwiftError*` value in the error register. Additionally, we have selected this design as this provides consistency with the self register and async context register handling, discussed below.