@@ -57,19 +57,8 @@ class ActorIsolation {
5757 // / the actor is isolated to the instance of that actor.
5858 ActorInstance,
5959 // / The declaration is explicitly specified to be not isolated to any actor,
60- // / meaning it cannot itself access actor isolated state but /does/ allow
61- // / for indirect access to actor isolated state if the declaration can
62- // / guarantee that all code generated to work with the declaration will run
63- // / on said actor.
64- // /
65- // / E.x.: a nonisolated function can accept actor-isolated values as
66- // / arguments since the caller knows that it will not escape the values to
67- // / another isolation domain and that the function will remain on the
68- // / caller's actor.
69- // /
70- // / NOTE: This used to have the meaning of Concurrent which is a stricter
71- // / definition of nonisolated that prevents the code generated to work with
72- // / the declaration to never touch actor isolated state.
60+ // / meaning that it can be used from any actor but is also unable to
61+ // / refer to the isolated state of any given actor.
7362 Nonisolated,
7463 // / The declaration is explicitly specified to be not isolated and with the
7564 // / "unsafe" annotation, which means that we do not enforce isolation.
@@ -85,20 +74,6 @@ class ActorIsolation {
8574 // / DISCUSSION: This is used for nonisolated asynchronous functions that we
8675 // / want to inherit from their context the context's actor isolation.
8776 CallerIsolationInheriting,
88- // / The declaration is explicitly specified to be not isolated to any actor,
89- // / meaning that it can be used from any actor but is also unable to
90- // / refer to the isolated state of any given actor.
91- // /
92- // / NOTE: This used to be nonisolated, but we changed nonisolated to have a
93- // / weaker definition of nonisolated that allows for actor isolated state to
94- // / be manipulated by code generated to work with the actor as long as all
95- // / such code generation is guaranteed to always run on whatever actor
96- // / isolation it is invoked in consistently and not escape the value to any
97- // / other isolation domain.
98- Concurrent,
99- // / The declaration is explicitly specified to be concurrent and with the
100- // / "unsafe" annotation, which means that we do not enforce isolation.
101- ConcurrentUnsafe,
10277 };
10378
10479private:
@@ -107,13 +82,13 @@ class ActorIsolation {
10782 Type globalActor;
10883 void *pointer;
10984 };
110- unsigned kind : 4 ;
85+ unsigned kind : 3 ;
11186 unsigned isolatedByPreconcurrency : 1 ;
11287
11388 // / Set to true if this was parsed from SIL.
11489 unsigned silParsed : 1 ;
11590
116- unsigned parameterIndex : 26 ;
91+ unsigned parameterIndex : 27 ;
11792
11893 ActorIsolation (Kind kind, NominalTypeDecl *actor, unsigned parameterIndex);
11994
@@ -137,10 +112,6 @@ class ActorIsolation {
137112 return ActorIsolation (unsafe ? NonisolatedUnsafe : Nonisolated);
138113 }
139114
140- static ActorIsolation forConcurrent (bool unsafe) {
141- return ActorIsolation (unsafe ? ConcurrentUnsafe : Concurrent);
142- }
143-
144115 static ActorIsolation forCallerIsolationInheriting () {
145116 // NOTE: We do not use parameter indices since the parameter is implicit
146117 // from the perspective of the AST.
@@ -197,10 +168,6 @@ class ActorIsolation {
197168 .Case (" caller_isolation_inheriting" ,
198169 std::optional<ActorIsolation>(
199170 ActorIsolation::CallerIsolationInheriting))
200- .Case (" concurrent" ,
201- std::optional<ActorIsolation>(ActorIsolation::Concurrent))
202- .Case (" concurrent_unsafe" , std::optional<ActorIsolation>(
203- ActorIsolation::ConcurrentUnsafe))
204171 .Default (std::nullopt );
205172 if (kind == std::nullopt )
206173 return std::nullopt ;
@@ -213,22 +180,12 @@ class ActorIsolation {
213180
214181 bool isUnspecified () const { return kind == Unspecified; }
215182
216- bool isConcurrent () const {
217- return (kind == Concurrent) || (kind == ConcurrentUnsafe);
218- }
219-
220- bool isConcurrentUnsafe () const { return kind == ConcurrentUnsafe; }
221-
222183 bool isNonisolated () const {
223184 return (kind == Nonisolated) || (kind == NonisolatedUnsafe);
224185 }
225186
226187 bool isNonisolatedUnsafe () const { return kind == NonisolatedUnsafe; }
227188
228- bool isUnsafe () const {
229- return kind == NonisolatedUnsafe || kind == ConcurrentUnsafe;
230- }
231-
232189 // / Retrieve the parameter to which actor-instance isolation applies.
233190 // /
234191 // / Parameter 0 is `self`.
@@ -256,8 +213,6 @@ class ActorIsolation {
256213 case Nonisolated:
257214 case NonisolatedUnsafe:
258215 case CallerIsolationInheriting:
259- case Concurrent:
260- case ConcurrentUnsafe:
261216 return false ;
262217 }
263218 }
0 commit comments