Skip to content

Commit 14e1822

Browse files
committed
Remove the ShouldNotDeallocateInCallee bit from AsyncContextFlags.
The original async ABI made callees deallocate the context, which allows tail calls (at the async-function level) but interferes with callers' ability to optimize callee frame allocation. The purpose of this bit was to allow callers to do that optimization, but we've since just made callers responsible for deallocating the context, which is overall just a lot simpler. So this has been dead for quite some time.
1 parent 78e45e4 commit 14e1822

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,6 @@ class AsyncContextFlags : public FlagSet<uint32_t> {
22112211
Kind_width = 8,
22122212

22132213
CanThrow = 8,
2214-
ShouldNotDeallocate = 9,
22152214

22162215
// Kind-specific flags should grow down from 31.
22172216

@@ -2231,18 +2230,6 @@ class AsyncContextFlags : public FlagSet<uint32_t> {
22312230
/// Whether this context is permitted to throw.
22322231
FLAGSET_DEFINE_FLAG_ACCESSORS(CanThrow, canThrow, setCanThrow)
22332232

2234-
/// Whether a function should avoid deallocating its context before
2235-
/// returning. It should still pass its caller's context to its
2236-
/// return continuation.
2237-
///
2238-
/// This flag can be set in the caller to optimize context allocation,
2239-
/// e.g. if the callee's context size is known statically and simply
2240-
/// allocated as part of the caller's context, or if the callee will
2241-
/// be called multiple times.
2242-
FLAGSET_DEFINE_FLAG_ACCESSORS(ShouldNotDeallocate,
2243-
shouldNotDeallocateInCallee,
2244-
setShouldNotDeallocateInCallee)
2245-
22462233
/// See AsyncContinuationFlags::isExecutorSwitchForced.
22472234
FLAGSET_DEFINE_FLAG_ACCESSORS(Continuation_IsExecutorSwitchForced,
22482235
continuation_isExecutorSwitchForced,

stdlib/public/Concurrency/Task.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ static AsyncTaskAndContext swift_task_create_commonImpl(
629629
// be is the final hop. Store a signed null instead.
630630
initialContext->Parent = nullptr;
631631
initialContext->Flags = AsyncContextKind::Ordinary;
632-
initialContext->Flags.setShouldNotDeallocateInCallee(true);
633632

634633
// Attach to the group, if needed.
635634
if (group) {

0 commit comments

Comments
 (0)