File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -1827,21 +1827,6 @@ class PartitionOpTranslator {
18271827 }
18281828
18291829 void translateNonIsolationCrossingSILApply (FullApplySite fas) {
1830- SILIsolationInfo isolationInfo;
1831-
1832- // If self is an actor and we are isolated to it, propagate actor self.
1833- if (fas.hasSelfArgument ()) {
1834- auto &self = fas.getSelfArgumentOperand ();
1835- if (fas.getArgumentParameterInfo (self).hasOption (
1836- SILParameterInfo::Isolated)) {
1837- if (auto *nomDecl =
1838- self.get ()->getType ().getNominalOrBoundGenericNominal ()) {
1839- // First try to see if this nom decl is isolated to an actor.
1840- isolationInfo = SILIsolationInfo::getActorIsolated (nomDecl);
1841- }
1842- }
1843- }
1844-
18451830 // For non-self parameters, gather all of the transferring parameters and
18461831 // gather our non-transferring parameters.
18471832 SmallVector<SILValue, 8 > nonTransferringParameters;
@@ -1883,6 +1868,7 @@ class PartitionOpTranslator {
18831868 getApplyResults (*fas, applyResults);
18841869
18851870 auto type = fas.getSubstCalleeSILType ().castTo <SILFunctionType>();
1871+ auto isolationInfo = SILIsolationInfo::get (*fas);
18861872
18871873 // If our result is not transferring, just do the normal multi-assign.
18881874 if (!type->hasTransferringResult ()) {
Original file line number Diff line number Diff line change @@ -48,6 +48,19 @@ SILIsolationInfo SILIsolationInfo::get(SILInstruction *inst) {
4848 if (auto fas = FullApplySite::isa (inst)) {
4949 if (auto crossing = fas.getIsolationCrossing ())
5050 return SILIsolationInfo::getActorIsolated (crossing->getCalleeIsolation ());
51+
52+ if (fas.hasSelfArgument ()) {
53+ auto &self = fas.getSelfArgumentOperand ();
54+ if (fas.getArgumentParameterInfo (self).hasOption (
55+ SILParameterInfo::Isolated)) {
56+ if (auto *nomDecl =
57+ self.get ()->getType ().getNominalOrBoundGenericNominal ()) {
58+ // TODO: We should be doing this off of the instance... what if we
59+ // have two instances of the same class?
60+ return SILIsolationInfo::getActorIsolated (nomDecl);
61+ }
62+ }
63+ }
5164 }
5265
5366 if (auto *pai = dyn_cast<PartialApplyInst>(inst)) {
You can’t perform that action at this time.
0 commit comments