Change the async ABI to not pass the active task and executor.

Most of the async runtime functions have been changed to not
expect the task and executor to be passed in.  When knowing the
task and executor is necessary, there are runtime functions
available to recover them.

The biggest change I had to make to a runtime function signature
was to swift_task_switch, which has been altered to expect to be
passed the context and resumption function instead of requiring
the caller to park the task.  This has the pleasant consequence
of allowing the implementation to very quickly turn around when
it recognizes that the current executor is satisfactory.  It does
mean that on arm64e we have to sign the continuation function
pointer as an argument and then potentially resign it when
assigning into the task's resume slot.

rdar://70546948
This commit is contained in:
John McCall
2021-03-15 01:42:30 -04:00
parent 549923513a
commit 6c879d6fd3
88 changed files with 623 additions and 683 deletions

View File

@@ -38,7 +38,7 @@ public:
void *PrivateData[NumWords_TaskGroup];
/// Upon a future task's completion, offer it to the task group it belongs to.
void offer(AsyncTask *completed, AsyncContext *context, ExecutorRef executor);
void offer(AsyncTask *completed, AsyncContext *context);
};
} // end namespace swift