Skip to content
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

[Tracking] Implement Mono support for Swift calling convention #94081

Closed
2 of 5 tasks
Tracked by #93631
kotlarmilos opened this issue Oct 27, 2023 · 3 comments
Closed
2 of 5 tasks
Tracked by #93631

[Tracking] Implement Mono support for Swift calling convention #94081

kotlarmilos opened this issue Oct 27, 2023 · 3 comments
Assignees
Labels
area-VM-meta-mono os-ios Apple iOS tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@kotlarmilos
Copy link
Member

kotlarmilos commented Oct 27, 2023

Description

The Swift programming language has a different ABI, runtime environment, and object model. This issue tracks the work for implementing Mono support for Swift calling convention according to the design document.

According to the calling convention, the self context has dedicated registers, and it is always passed through them since it's heavily used. Methods calling other methods on the same object can share the self context. Errors are also handled through registers, so the caller needs to check for errors and throw if necessary. Implementing P/Invoke thunks should simplify registers juggling by using predefined set of registers in these scenarios.

Below is a list of tasks that needs to be implemented. Please note that the breakdown of the issues does not impose hard deadlines. If some of the functionality does not get upstreamed for a particular preview version, this issue will be updated accordingly.

Tasks

@kotlarmilos kotlarmilos added area-VM-meta-mono tracking This issue is tracking the completion of other related issues. os-ios Apple iOS labels Oct 27, 2023
@kotlarmilos kotlarmilos added this to the 9.0.0 milestone Oct 27, 2023
@ghost
Copy link

ghost commented Oct 27, 2023

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

This issue tracks the work for implementing Mono support for Swift calling convention according to the design document.

List of tasks:

  • Add CallConvSwift unmanaged calling convention and SwiftSelf/SwiftError types
  • Implement self context support by emitting thunks that store a SwiftSelf argument into the self register
    • Implement mini support for x64 and arm64
    • Implement LLVM support for x64 and arm64
    • Implement Interpreter support
  • Implement error handling support by emitting thunks that retrieve the error register as SwiftError* argument
    • Implement mini support for x64 and arm64
    • Implement LLVM support for x64 and arm64
    • Implement Interpreter support
  • Throw an InvalidProgramException for a signature with multiple SwiftSelf/SwiftError* parameters
Author: kotlarmilos
Assignees: kotlarmilos, matouskozak
Labels:

area-VM-meta-mono, tracking, os-ios

Milestone: 9.0.0

@ShikiSuen
Copy link

Please don't forget the InputMethodKit framework support for this time.

The InputMethodKit C# Support was absent during the entire Xamarin era.

@kotlarmilos
Copy link
Member Author

The remaining tasks have been moved to the parent tracking issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-meta-mono os-ios Apple iOS tracking This issue is tracking the completion of other related issues.
Projects
None yet
Development

No branches or pull requests

3 participants