Skip to content

Commit 8c4dea9

Browse files
authored
Revert "[concurrency] Add support for HopToMainActorIfNeededThunk." (#79938)
* Revert "[concurrency] Add support for HopToMainActorIfNeededThunk." This reverts commit 0e0665b. * remove some last bits of 0e0665b
1 parent 1a08018 commit 8c4dea9

27 files changed

+1
-729
lines changed

include/swift/AST/SILThunkKind.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ struct SILThunkKind {
3434
/// purposes of the underlying thunking machinery.
3535
Identity = 1,
3636

37-
/// A thunk that checks if a value is on the main actor and if it isn't
38-
/// jumps to the main actor. It expects that the passed in function does not
39-
/// have any arguments, results, is synchronous, and does not throw.
40-
HopToMainActorIfNeeded = 2,
41-
42-
MaxValue = HopToMainActorIfNeeded,
37+
MaxValue = Identity,
4338
};
4439

4540
InnerTy innerTy;
@@ -73,8 +68,6 @@ struct SILThunkKind {
7368
return Demangle::MangledSILThunkKind::Invalid;
7469
case Identity:
7570
return Demangle::MangledSILThunkKind::Identity;
76-
case HopToMainActorIfNeeded:
77-
return Demangle::MangledSILThunkKind::HopToMainActorIfNeeded;
7871
}
7972
}
8073
};

include/swift/Basic/Features.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,6 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(CoroutineAccessors, true)
476476
/// modify/read single-yield coroutines always execute code post-yield code
477477
EXPERIMENTAL_FEATURE(CoroutineAccessorsUnwindOnCallerError, false)
478478

479-
/// When a parameter has unspecified isolation, infer it as main actor isolated.
480-
EXPERIMENTAL_FEATURE(GenerateForceToMainActorThunks, false)
481-
482479
EXPERIMENTAL_FEATURE(AddressableParameters, true)
483480
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(AddressableTypes, true)
484481

include/swift/Demangling/Demangle.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ enum class MangledDifferentiabilityKind : char {
141141
enum class MangledSILThunkKind : char {
142142
Invalid = 0,
143143
Identity = 'I',
144-
HopToMainActorIfNeeded = 'H',
145144
};
146145

147146
/// The pass that caused the specialization to occur. We use this to make sure

include/swift/Demangling/DemangleNodes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ NODE(ReflectionMetadataSuperclassDescriptor)
294294
NODE(GenericTypeParamDecl)
295295
NODE(CurryThunk)
296296
NODE(SILThunkIdentity)
297-
NODE(SILThunkHopToMainActorIfNeeded)
298297
NODE(DispatchThunk)
299298
NODE(MethodDescriptor)
300299
NODE(ProtocolRequirementsBaseDescriptor)

include/swift/SIL/SILBuilder.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,13 +1239,6 @@ class SILBuilder {
12391239
return createThunk(Loc, Op, ThunkInst::Kind::Identity, substitutionMap);
12401240
}
12411241

1242-
ThunkInst *
1243-
createHopToMainActorIfNeededThunk(SILLocation Loc, SILValue Op,
1244-
SubstitutionMap substitutionMap = {}) {
1245-
return createThunk(Loc, Op, ThunkInst::Kind::HopToMainActorIfNeeded,
1246-
substitutionMap);
1247-
}
1248-
12491242
ConvertEscapeToNoEscapeInst *
12501243
createConvertEscapeToNoEscape(SILLocation Loc, SILValue Op, SILType Ty,
12511244
bool lifetimeGuaranteed) {

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ UNINTERESTING_FEATURE(ExtractConstantsFromMembers)
199199
UNINTERESTING_FEATURE(GroupActorErrors)
200200
UNINTERESTING_FEATURE(SameElementRequirements)
201201
UNINTERESTING_FEATURE(UnspecifiedMeansMainActorIsolated)
202-
UNINTERESTING_FEATURE(GenerateForceToMainActorThunks)
203202

204203
static bool usesFeatureSendingArgsAndResults(Decl *decl) {
205204
auto isFunctionTypeWithSending = [](Type type) {

lib/Demangling/Demangler.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,9 +2859,6 @@ NodePointer Demangler::demangleThunkOrSpecialization() {
28592859
switch (nextChar()) {
28602860
case 'I':
28612861
return createWithChild(Node::Kind::SILThunkIdentity, popNode(isEntity));
2862-
case 'H':
2863-
return createWithChild(Node::Kind::SILThunkHopToMainActorIfNeeded,
2864-
popNode(isEntity));
28652862
default:
28662863
return nullptr;
28672864
}

lib/Demangling/NodePrinter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ class NodePrinter {
369369
case Node::Kind::CoroutineContinuationPrototype:
370370
case Node::Kind::CurryThunk:
371371
case Node::Kind::SILThunkIdentity:
372-
case Node::Kind::SILThunkHopToMainActorIfNeeded:
373372
case Node::Kind::DispatchThunk:
374373
case Node::Kind::Deallocator:
375374
case Node::Kind::IsolatedDeallocator:
@@ -1454,10 +1453,6 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
14541453
Printer << "identity thunk of ";
14551454
print(Node->getChild(0), depth + 1);
14561455
return nullptr;
1457-
case Node::Kind::SILThunkHopToMainActorIfNeeded:
1458-
Printer << "hop to main actor thunk of ";
1459-
print(Node->getChild(0), depth + 1);
1460-
return nullptr;
14611456
case Node::Kind::DispatchThunk:
14621457
Printer << "dispatch thunk of ";
14631458
print(Node->getChild(0), depth + 1);

lib/Demangling/OldRemangler.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,12 +2545,6 @@ ManglingError Remangler::mangleSILThunkIdentity(Node *node, unsigned depth) {
25452545
return ManglingError::Success;
25462546
}
25472547

2548-
ManglingError Remangler::mangleSILThunkHopToMainActorIfNeeded(Node *node,
2549-
unsigned depth) {
2550-
Buffer << "<sil-hop-to-main-actor-if-needed-thunk>";
2551-
return ManglingError::Success;
2552-
}
2553-
25542548
ManglingError Remangler::mangleDispatchThunk(Node *node, unsigned depth) {
25552549
Buffer << "<dispatch-thunk>";
25562550
return ManglingError::Success;

lib/Demangling/Remangler.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,14 +3403,6 @@ ManglingError Remangler::mangleSILThunkIdentity(Node *node, unsigned depth) {
34033403
return ManglingError::Success;
34043404
}
34053405

3406-
ManglingError Remangler::mangleSILThunkHopToMainActorIfNeeded(Node *node,
3407-
unsigned depth) {
3408-
RETURN_IF_ERROR(mangleSingleChildNode(node, depth + 1)); // type
3409-
Buffer << "TT"
3410-
<< "H";
3411-
return ManglingError::Success;
3412-
}
3413-
34143406
ManglingError Remangler::mangleDispatchThunk(Node *node, unsigned depth) {
34153407
RETURN_IF_ERROR(mangleSingleChildNode(node, depth + 1));
34163408
Buffer << "Tj";

0 commit comments

Comments
 (0)