Skip to content

[Concurrency] Async CC, part 1. #34141

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

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Oct 1, 2020

Here, the following is implemented:

  • Construction of SwiftContext struct with the fields needed for calling functions.
  • Allocating and deallocating these swift context via runtime calls before calling async functions and after returning from them.
  • Storing arguments (including bindings and the self parameter but not including protocol fields for witness methods) and returns (both direct (however the convention is currently ignorend) and indirect).
  • Wrangling errors.

Additional things that still need to be done:

  • interaction between async function contexts and coroutine contexts
  • yields from async functions
  • partial applies of async functions

To support, a couple of structural changes were helpful:

  • addition of a small EntryPointCallingConvention class hierarchy
  • addition of a couple of subclasses of CallEmission

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Oct 1, 2020

Build failed
Swift Test Linux Platform
Git Sha - b7de037aee225c7871036f533ab15b7ff6ca1c00

@swift-ci
Copy link
Contributor

swift-ci commented Oct 1, 2020

Build failed
Swift Test OS X Platform
Git Sha - b7de037aee225c7871036f533ab15b7ff6ca1c00

@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch 3 times, most recently from 83074dc to f42a7e9 Compare October 2, 2020 01:20
@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch 3 times, most recently from 613a479 to cb57212 Compare October 2, 2020 15:39
@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch 3 times, most recently from e653e21 to c6a39d5 Compare October 2, 2020 17:18
This reverts commit 3a48396110d2639d7b90970bc0369a559adbc0c1.
@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch 2 times, most recently from 566c691 to 9106710 Compare October 3, 2020 01:05
@nate-chandler nate-chandler changed the title First steps towards calling convention for async functions. [Concurrency] Async CC, part 1. Oct 3, 2020
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler marked this pull request as ready for review October 3, 2020 01:08
@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch from 9106710 to a865feb Compare October 3, 2020 01:10
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch from a865feb to 08dc8a2 Compare October 3, 2020 01:20
@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch from 08dc8a2 to ee3d1d1 Compare October 3, 2020 03:21
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows

@nate-chandler
Copy link
Contributor Author

@swift-ci please asan test

@swift-ci
Copy link
Contributor

swift-ci commented Oct 3, 2020

Build failed
Swift Test Linux Platform
Git Sha - ee3d1d1a305392bae3ee32dcaff529b7a793df0c

@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch 3 times, most recently from 3ffb05c to 1c38310 Compare October 5, 2020 17:51
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Oct 5, 2020

Build failed
Swift Test OS X Platform
Git Sha - 1c38310901d0559e9dc35c56602b987409be92f2

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

LGTM.

@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch from 1c38310 to a4eb7e5 Compare October 5, 2020 18:49
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows

@swift-ci
Copy link
Contributor

swift-ci commented Oct 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - a4eb7e50b3a6c375888430cde4344eebc4a02997

@nate-chandler
Copy link
Contributor Author

@swift-ci please test linux

@swift-ci
Copy link
Contributor

swift-ci commented Oct 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - a4eb7e50b3a6c375888430cde4344eebc4a02997

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test linux

@swift-ci
Copy link
Contributor

swift-ci commented Oct 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - a4eb7e50b3a6c375888430cde4344eebc4a02997

@swift-ci
Copy link
Contributor

swift-ci commented Oct 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - 1c38310901d0559e9dc35c56602b987409be92f2

@nate-chandler
Copy link
Contributor Author

@swift-ci please test linux

@swift-ci
Copy link
Contributor

swift-ci commented Oct 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - a4eb7e50b3a6c375888430cde4344eebc4a02997

@nate-chandler
Copy link
Contributor Author

@swift-ci please test linux

@swift-ci
Copy link
Contributor

swift-ci commented Oct 6, 2020

Build failed
Swift Test Linux Platform
Git Sha - a4eb7e50b3a6c375888430cde4344eebc4a02997

Here, the following is implemented:
- Construction of SwiftContext struct with the fields needed for calling
  functions.
- Allocating and deallocating these swift context via runtime calls
  before calling async functions and after returning from them.
- Storing arguments (including bindings and the self parameter but not
  including protocol fields for witness methods) and returns (both
  direct and indirect).
- Calling async functions.

Additional things that still need to be done:
- protocol extension methods
- protocol witness methods
- storing yields
- partial applies
@nate-chandler nate-chandler force-pushed the concurrency/irgen/signature branch from a4eb7e5 to ee88152 Compare October 6, 2020 03:44
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows

@nate-chandler nate-chandler merged commit 515f0db into swiftlang:main Oct 6, 2020
@nate-chandler nate-chandler deleted the concurrency/irgen/signature branch October 6, 2020 14:43
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