@@ -564,7 +564,8 @@ namespace {
564
564
} // end anonymous namespace
565
565
566
566
static SILValue enterAccessScope (SILGenFunction &SGF, SILLocation loc,
567
- SILValue addr, LValueTypeData typeData,
567
+ ManagedValue base, SILValue addr,
568
+ LValueTypeData typeData,
568
569
SGFAccessKind accessKind,
569
570
SILAccessEnforcement enforcement,
570
571
Optional<ActorIsolation> actorIso) {
@@ -574,10 +575,8 @@ static SILValue enterAccessScope(SILGenFunction &SGF, SILLocation loc,
574
575
assert (SGF.isInFormalEvaluationScope () &&
575
576
" tried to enter access scope without a writeback scope!" );
576
577
577
- // Only expecting global-actor isolation here, since there's no base / self.
578
- assert (!actorIso || actorIso->isGlobalActor ());
579
578
ExecutorBreadcrumb prevExecutor =
580
- SGF.emitHopToTargetActor (loc, actorIso, /* maybeSelf= */ None );
579
+ SGF.emitHopToTargetActor (loc, actorIso, base );
581
580
582
581
// Enter the access.
583
582
addr = SGF.B .createBeginAccess (loc, addr, silAccessKind, enforcement,
@@ -596,13 +595,14 @@ static SILValue enterAccessScope(SILGenFunction &SGF, SILLocation loc,
596
595
}
597
596
598
597
static ManagedValue enterAccessScope (SILGenFunction &SGF, SILLocation loc,
599
- ManagedValue addr, LValueTypeData typeData,
598
+ ManagedValue base, ManagedValue addr,
599
+ LValueTypeData typeData,
600
600
SGFAccessKind accessKind,
601
601
SILAccessEnforcement enforcement,
602
602
Optional<ActorIsolation> actorIso) {
603
603
return ManagedValue::forLValue (
604
- enterAccessScope (SGF, loc, addr.getLValueAddress (), typeData,
605
- accessKind, enforcement, actorIso));
604
+ enterAccessScope (SGF, loc, base , addr.getLValueAddress (), typeData,
605
+ accessKind, enforcement, actorIso));
606
606
}
607
607
608
608
// Find the base of the formal access at `address`. If the base requires an
@@ -758,7 +758,7 @@ namespace {
758
758
// declarations. Access marker verification is aware of these cases.
759
759
if (!IsNonAccessing && !Field->isLet ()) {
760
760
if (auto enforcement = SGF.getDynamicEnforcement (Field)) {
761
- result = enterAccessScope (SGF, loc, result, getTypeData (),
761
+ result = enterAccessScope (SGF, loc, base, result, getTypeData (),
762
762
getAccessKind (), *enforcement,
763
763
takeActorIsolation ());
764
764
}
@@ -1034,9 +1034,9 @@ namespace {
1034
1034
return Value;
1035
1035
1036
1036
SILValue addr = Value.getLValueAddress ();
1037
- addr = enterAccessScope (SGF, loc, addr, getTypeData (),
1038
- getAccessKind (), *Enforcement ,
1039
- takeActorIsolation ());
1037
+ addr =
1038
+ enterAccessScope (SGF, loc, base, addr, getTypeData (), getAccessKind () ,
1039
+ *Enforcement, takeActorIsolation ());
1040
1040
1041
1041
return ManagedValue::forLValue (addr);
1042
1042
}
@@ -1798,9 +1798,9 @@ namespace {
1798
1798
}
1799
1799
1800
1800
// Enter an unsafe access scope for the access.
1801
- addr = enterAccessScope (SGF, loc, addr, getTypeData (), getAccessKind (),
1802
- SILAccessEnforcement::Unsafe ,
1803
- ActorIso);
1801
+ addr =
1802
+ enterAccessScope (SGF, loc, base, addr, getTypeData (), getAccessKind () ,
1803
+ SILAccessEnforcement::Unsafe, ActorIso);
1804
1804
1805
1805
return addr;
1806
1806
}
0 commit comments