@@ -57,19 +57,8 @@ class ActorIsolation {
57
57
// / the actor is isolated to the instance of that actor.
58
58
ActorInstance,
59
59
// / 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.
73
62
Nonisolated,
74
63
// / The declaration is explicitly specified to be not isolated and with the
75
64
// / "unsafe" annotation, which means that we do not enforce isolation.
@@ -85,20 +74,6 @@ class ActorIsolation {
85
74
// / DISCUSSION: This is used for nonisolated asynchronous functions that we
86
75
// / want to inherit from their context the context's actor isolation.
87
76
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,
102
77
};
103
78
104
79
private:
@@ -107,13 +82,13 @@ class ActorIsolation {
107
82
Type globalActor;
108
83
void *pointer;
109
84
};
110
- unsigned kind : 4 ;
85
+ unsigned kind : 3 ;
111
86
unsigned isolatedByPreconcurrency : 1 ;
112
87
113
88
// / Set to true if this was parsed from SIL.
114
89
unsigned silParsed : 1 ;
115
90
116
- unsigned parameterIndex : 26 ;
91
+ unsigned parameterIndex : 27 ;
117
92
118
93
ActorIsolation (Kind kind, NominalTypeDecl *actor, unsigned parameterIndex);
119
94
@@ -137,10 +112,6 @@ class ActorIsolation {
137
112
return ActorIsolation (unsafe ? NonisolatedUnsafe : Nonisolated);
138
113
}
139
114
140
- static ActorIsolation forConcurrent (bool unsafe) {
141
- return ActorIsolation (unsafe ? ConcurrentUnsafe : Concurrent);
142
- }
143
-
144
115
static ActorIsolation forCallerIsolationInheriting () {
145
116
// NOTE: We do not use parameter indices since the parameter is implicit
146
117
// from the perspective of the AST.
@@ -197,10 +168,6 @@ class ActorIsolation {
197
168
.Case (" caller_isolation_inheriting" ,
198
169
std::optional<ActorIsolation>(
199
170
ActorIsolation::CallerIsolationInheriting))
200
- .Case (" concurrent" ,
201
- std::optional<ActorIsolation>(ActorIsolation::Concurrent))
202
- .Case (" concurrent_unsafe" , std::optional<ActorIsolation>(
203
- ActorIsolation::ConcurrentUnsafe))
204
171
.Default (std::nullopt );
205
172
if (kind == std::nullopt )
206
173
return std::nullopt ;
@@ -213,22 +180,12 @@ class ActorIsolation {
213
180
214
181
bool isUnspecified () const { return kind == Unspecified; }
215
182
216
- bool isConcurrent () const {
217
- return (kind == Concurrent) || (kind == ConcurrentUnsafe);
218
- }
219
-
220
- bool isConcurrentUnsafe () const { return kind == ConcurrentUnsafe; }
221
-
222
183
bool isNonisolated () const {
223
184
return (kind == Nonisolated) || (kind == NonisolatedUnsafe);
224
185
}
225
186
226
187
bool isNonisolatedUnsafe () const { return kind == NonisolatedUnsafe; }
227
188
228
- bool isUnsafe () const {
229
- return kind == NonisolatedUnsafe || kind == ConcurrentUnsafe;
230
- }
231
-
232
189
// / Retrieve the parameter to which actor-instance isolation applies.
233
190
// /
234
191
// / Parameter 0 is `self`.
@@ -256,8 +213,6 @@ class ActorIsolation {
256
213
case Nonisolated:
257
214
case NonisolatedUnsafe:
258
215
case CallerIsolationInheriting:
259
- case Concurrent:
260
- case ConcurrentUnsafe:
261
216
return false ;
262
217
}
263
218
}
0 commit comments