-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: get/await_async_continuation support #34829
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
IRGen: get/await_async_continuation support #34829
Conversation
rdar://71124933
@swift-ci please test |
@swift-ci Please smoke test |
// SwiftError *errResult; | ||
// union { | ||
// IndirectResult *result; | ||
// DirectResult *result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between IndirectResult and DirectResult?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, really.
Sometimes, we store direct results directly in a data structure.
In such a case I would have written:
struct {
// AsyncContext *resumeCtxt;
// void *awaitSynchronization;
// SwiftError *errResult;
// union {
// IndirectResult *result;
// DirectResult result;
I wanted to point out that the storage for both cases is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so for a word-sized result, we store it directly in the context? That makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't currently.
With the sentence:
Sometimes, we store direct results directly in a data structure.
I wanted to say: In other places such as the context passed to async functions (not the continuation context mentioned here) we store direct results in place and indirect results by address:
https://github.com/apple/swift/blob/main/lib/IRGen/GenCall.cpp#L161
https://github.com/apple/swift/blob/main/lib/IRGen/GenCall.cpp#L190
The notation:
// union {
// IndirectResult *result;
// DirectResult *result;
is meant to convey that both direct and indirect results are stored the same (as addresses to memory that stores the result).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On net, I think just saying Result*
would probably be clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci please test |
@swift-ci Please smoke test |
rdar://71124933