@@ -130,7 +130,7 @@ private static Object[] prepareArguments(PGenerator self) {
130
130
return arguments ;
131
131
}
132
132
133
- public static void checkResumable (PythonBuiltinBaseNode node , PGenerator self ) {
133
+ private static void checkResumable (PythonBuiltinBaseNode node , PGenerator self ) {
134
134
if (self .isFinished ()) {
135
135
throw node .raise (StopIteration );
136
136
}
@@ -145,7 +145,7 @@ abstract static class ResumeGeneratorNode extends Node {
145
145
public abstract Object execute (VirtualFrame frame , PGenerator self , Object sendValue );
146
146
147
147
@ Specialization (guards = "sameCallTarget(self.getCurrentCallTarget(), call.getCallTarget())" , limit = "getCallSiteInlineCacheMaxDepth()" )
148
- public Object cached (VirtualFrame frame , PGenerator self , Object sendValue ,
148
+ static Object cached (VirtualFrame frame , PGenerator self , Object sendValue ,
149
149
@ Cached ("createDirectCall(self.getCurrentCallTarget())" ) CallTargetInvokeNode call ) {
150
150
self .setRunning (true );
151
151
Object [] arguments = prepareArguments (self );
@@ -164,7 +164,7 @@ public Object cached(VirtualFrame frame, PGenerator self, Object sendValue,
164
164
}
165
165
166
166
@ Specialization (replaces = "cached" )
167
- public Object generic (VirtualFrame frame , PGenerator self , Object sendValue ,
167
+ static Object generic (VirtualFrame frame , PGenerator self , Object sendValue ,
168
168
@ Cached GenericInvokeNode call ) {
169
169
self .setRunning (true );
170
170
Object [] arguments = prepareArguments (self );
@@ -200,18 +200,18 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
200
200
@ GenerateNodeFactory
201
201
abstract static class NameNode extends PythonBinaryBuiltinNode {
202
202
@ Specialization (guards = "isNoValue(noValue)" )
203
- Object getName (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
203
+ static Object getName (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
204
204
return self .getName ();
205
205
}
206
206
207
207
@ Specialization
208
- Object setName (PGenerator self , String value ) {
208
+ static Object setName (PGenerator self , String value ) {
209
209
self .setName (value );
210
210
return PNone .NONE ;
211
211
}
212
212
213
213
@ Specialization (guards = "!isNoValue(value)" )
214
- Object setName (PGenerator self , Object value ,
214
+ static Object setName (PGenerator self , Object value ,
215
215
@ Cached StringNodes .CastToJavaStringCheckedNode cast ) {
216
216
return setName (self , cast .cast (value , ErrorMessages .MUST_BE_SET_TO_STR_OBJ , "__name__" ));
217
217
}
@@ -221,18 +221,18 @@ Object setName(PGenerator self, Object value,
221
221
@ GenerateNodeFactory
222
222
abstract static class QualnameNode extends PythonBinaryBuiltinNode {
223
223
@ Specialization (guards = "isNoValue(noValue)" )
224
- Object getQualname (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
224
+ static Object getQualname (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
225
225
return self .getQualname ();
226
226
}
227
227
228
228
@ Specialization
229
- Object setQualname (PGenerator self , String value ) {
229
+ static Object setQualname (PGenerator self , String value ) {
230
230
self .setQualname (value );
231
231
return PNone .NONE ;
232
232
}
233
233
234
234
@ Specialization (guards = "!isNoValue(value)" )
235
- Object setQualname (PGenerator self , Object value ,
235
+ static Object setQualname (PGenerator self , Object value ,
236
236
@ Cached StringNodes .CastToJavaStringCheckedNode cast ) {
237
237
return setQualname (self , cast .cast (value , ErrorMessages .MUST_BE_SET_TO_STR_OBJ , "__qualname__" ));
238
238
}
@@ -243,7 +243,7 @@ Object setQualname(PGenerator self, Object value,
243
243
public abstract static class IterNode extends PythonUnaryBuiltinNode {
244
244
245
245
@ Specialization
246
- public Object iter (PGenerator self ) {
246
+ static Object iter (PGenerator self ) {
247
247
return self ;
248
248
}
249
249
}
@@ -252,7 +252,7 @@ public Object iter(PGenerator self) {
252
252
@ GenerateNodeFactory
253
253
public abstract static class NextNode extends PythonUnaryBuiltinNode {
254
254
@ Specialization
255
- public Object next (VirtualFrame frame , PGenerator self ,
255
+ Object next (VirtualFrame frame , PGenerator self ,
256
256
@ Cached ResumeGeneratorNode resumeGeneratorNode ) {
257
257
checkResumable (this , self );
258
258
return resumeGeneratorNode .execute (frame , self , null );
@@ -264,7 +264,7 @@ public Object next(VirtualFrame frame, PGenerator self,
264
264
public abstract static class SendNode extends PythonBuiltinNode {
265
265
266
266
@ Specialization
267
- public Object send (VirtualFrame frame , PGenerator self , Object value ,
267
+ Object send (VirtualFrame frame , PGenerator self , Object value ,
268
268
@ Cached ResumeGeneratorNode resumeGeneratorNode ) {
269
269
checkResumable (this , self );
270
270
return resumeGeneratorNode .execute (frame , self , value );
@@ -280,19 +280,19 @@ abstract static class ThrowNode extends PythonBuiltinNode {
280
280
@ Child private GetTracebackNode getTracebackNode ;
281
281
282
282
@ ImportStatic ({PGuards .class , SpecialMethodNames .class })
283
- public abstract static class PrepareExceptionNode extends Node {
283
+ abstract static class PrepareExceptionNode extends Node {
284
284
public abstract PBaseException execute (VirtualFrame frame , Object type , Object value );
285
285
286
286
private PRaiseNode raiseNode ;
287
287
private IsSubtypeNode isSubtypeNode ;
288
288
289
289
@ Specialization
290
- PBaseException doException (PBaseException exc , @ SuppressWarnings ("unused" ) PNone value ) {
290
+ static PBaseException doException (PBaseException exc , @ SuppressWarnings ("unused" ) PNone value ) {
291
291
return exc ;
292
292
}
293
293
294
294
@ Specialization (guards = "!isPNone(value)" )
295
- PBaseException doException (@ SuppressWarnings ("unused" ) PBaseException exc , @ SuppressWarnings ("unused" ) Object value ,
295
+ static PBaseException doException (@ SuppressWarnings ("unused" ) PBaseException exc , @ SuppressWarnings ("unused" ) Object value ,
296
296
@ Cached PRaiseNode raise ) {
297
297
throw raise .raise (PythonBuiltinClassType .TypeError , ErrorMessages .INSTANCE_EX_MAY_NOT_HAVE_SEP_VALUE );
298
298
}
0 commit comments