mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Concurrency: Redo non-_f variants of swift_task_create to accept closures as is.
In their previous form, the non-`_f` variants of these entry points were unused, and IRGen lowered the `createAsyncTask` builtins to use the `_f` variants with a large amount of caller-side codegen to manually unpack closure values. Amid all this, it also failed to make anyone responsible for releasing the closure context after the task completed, causing every task creation to leak. Redo the `swift_task_create_*` entry points to accept the two words of an async closure value directly, and unpack the closure to get its invocation entry point and initial context size inside the runtime. (Also get rid of the non-future `swift_task_create` variant, since it's unused and it's subtly different in a lot of hairy ways from the future forms. Better to add it later when it's needed than to have a broken unexercised version now.)
This commit is contained in:
@@ -1813,7 +1813,6 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
|
||||
case BuiltinValueKind::IntInstrprofIncrement:
|
||||
case BuiltinValueKind::TSanInoutAccess:
|
||||
case BuiltinValueKind::CancelAsyncTask:
|
||||
case BuiltinValueKind::CreateAsyncTask:
|
||||
case BuiltinValueKind::CreateAsyncTaskFuture:
|
||||
case BuiltinValueKind::CreateAsyncTaskGroupFuture:
|
||||
case BuiltinValueKind::AutoDiffCreateLinearMapContext:
|
||||
|
||||
Reference in New Issue
Block a user