Skip to content

SILGen: Caller-side codegen for invoking foreign async functions #34525

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

Merged
merged 3 commits into from
Nov 12, 2020

Conversation

jckarter
Copy link
Contributor

Immediately before invoking the ObjC API, get the current continuation, capture it into a block to
pass as the completion handler, and then await the continuation, whose resume/error successors
serve as the semantic return/throw result of the call. This should complete the caller-side part
of SILGen; the completion handler block implementation is however still only a stub.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 39ae951619b44049692813ea18407e39cd981a37

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 39ae951619b44049692813ea18407e39cd981a37

@jckarter
Copy link
Contributor Author

jckarter commented Nov 2, 2020

@swift-ci Please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great start!

@jckarter
Copy link
Contributor Author

jckarter commented Nov 3, 2020

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 3, 2020

Build failed
Swift Test Linux Platform
Git Sha - 7addae24396abe87d67c882a8b0df707fa6d3b6f

@swift-ci
Copy link
Contributor

swift-ci commented Nov 3, 2020

Build failed
Swift Test OS X Platform
Git Sha - 7addae24396abe87d67c882a8b0df707fa6d3b6f

Immediately before invoking the ObjC API, get the current continuation, capture it into a block to
pass as the completion handler, and then await the continuation, whose resume/error successors
serve as the semantic return/throw result of the call. This should complete the caller-side part
of SILGen; the completion handler block implementation is however still only a stub.
…time.

To manage code size in user binaries, we want to be able to implement common completion handler signatures in
the Swift runtime once. Using a different mangling for these lets us add new ones without clobbering symbols in
existing binaries.
@jckarter jckarter force-pushed the foreign-async-silgen branch from 7addae2 to 4b33f26 Compare November 3, 2020 20:29
@jckarter
Copy link
Contributor Author

jckarter commented Nov 3, 2020

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nifty!

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 368dc0f

@jckarter
Copy link
Contributor Author

@swift-ci Please test Linux

@jckarter jckarter merged commit 0ca29b5 into swiftlang:main Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants