Skip to content

Commit f73eff7

Browse files
committed
[Async CC] Save parent executor into context.
When an async function is called from an async function, the caller stores its own executor into the the callee's context in the ResumeParentExecutor field.
1 parent c9e567b commit f73eff7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,6 +2205,12 @@ class AsyncCallEmission final : public CallEmission {
22052205
auto fieldLayout = layout.getParentLayout();
22062206
saveValue(fieldLayout, explosion, isOutlined);
22072207
}
2208+
{ // caller executor
2209+
Explosion explosion;
2210+
explosion.add(IGF.getAsyncExecutor());
2211+
auto fieldLayout = layout.getResumeParentExecutorLayout();
2212+
saveValue(fieldLayout, explosion, isOutlined);
2213+
}
22082214
// Move all the arguments into the context.
22092215
for (unsigned index = 0, count = layout.getIndirectReturnCount();
22102216
index < count; ++index) {

0 commit comments

Comments
 (0)