@@ -130,7 +130,7 @@ private static Object[] prepareArguments(PGenerator self) {
130130 return arguments ;
131131 }
132132
133- public static void checkResumable (PythonBuiltinBaseNode node , PGenerator self ) {
133+ private static void checkResumable (PythonBuiltinBaseNode node , PGenerator self ) {
134134 if (self .isFinished ()) {
135135 throw node .raise (StopIteration );
136136 }
@@ -145,7 +145,7 @@ abstract static class ResumeGeneratorNode extends Node {
145145 public abstract Object execute (VirtualFrame frame , PGenerator self , Object sendValue );
146146
147147 @ 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 ,
149149 @ Cached ("createDirectCall(self.getCurrentCallTarget())" ) CallTargetInvokeNode call ) {
150150 self .setRunning (true );
151151 Object [] arguments = prepareArguments (self );
@@ -164,7 +164,7 @@ public Object cached(VirtualFrame frame, PGenerator self, Object sendValue,
164164 }
165165
166166 @ Specialization (replaces = "cached" )
167- public Object generic (VirtualFrame frame , PGenerator self , Object sendValue ,
167+ static Object generic (VirtualFrame frame , PGenerator self , Object sendValue ,
168168 @ Cached GenericInvokeNode call ) {
169169 self .setRunning (true );
170170 Object [] arguments = prepareArguments (self );
@@ -200,18 +200,18 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
200200 @ GenerateNodeFactory
201201 abstract static class NameNode extends PythonBinaryBuiltinNode {
202202 @ Specialization (guards = "isNoValue(noValue)" )
203- Object getName (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
203+ static Object getName (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
204204 return self .getName ();
205205 }
206206
207207 @ Specialization
208- Object setName (PGenerator self , String value ) {
208+ static Object setName (PGenerator self , String value ) {
209209 self .setName (value );
210210 return PNone .NONE ;
211211 }
212212
213213 @ Specialization (guards = "!isNoValue(value)" )
214- Object setName (PGenerator self , Object value ,
214+ static Object setName (PGenerator self , Object value ,
215215 @ Cached StringNodes .CastToJavaStringCheckedNode cast ) {
216216 return setName (self , cast .cast (value , ErrorMessages .MUST_BE_SET_TO_STR_OBJ , "__name__" ));
217217 }
@@ -221,18 +221,18 @@ Object setName(PGenerator self, Object value,
221221 @ GenerateNodeFactory
222222 abstract static class QualnameNode extends PythonBinaryBuiltinNode {
223223 @ Specialization (guards = "isNoValue(noValue)" )
224- Object getQualname (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
224+ static Object getQualname (PGenerator self , @ SuppressWarnings ("unused" ) PNone noValue ) {
225225 return self .getQualname ();
226226 }
227227
228228 @ Specialization
229- Object setQualname (PGenerator self , String value ) {
229+ static Object setQualname (PGenerator self , String value ) {
230230 self .setQualname (value );
231231 return PNone .NONE ;
232232 }
233233
234234 @ Specialization (guards = "!isNoValue(value)" )
235- Object setQualname (PGenerator self , Object value ,
235+ static Object setQualname (PGenerator self , Object value ,
236236 @ Cached StringNodes .CastToJavaStringCheckedNode cast ) {
237237 return setQualname (self , cast .cast (value , ErrorMessages .MUST_BE_SET_TO_STR_OBJ , "__qualname__" ));
238238 }
@@ -243,7 +243,7 @@ Object setQualname(PGenerator self, Object value,
243243 public abstract static class IterNode extends PythonUnaryBuiltinNode {
244244
245245 @ Specialization
246- public Object iter (PGenerator self ) {
246+ static Object iter (PGenerator self ) {
247247 return self ;
248248 }
249249 }
@@ -252,7 +252,7 @@ public Object iter(PGenerator self) {
252252 @ GenerateNodeFactory
253253 public abstract static class NextNode extends PythonUnaryBuiltinNode {
254254 @ Specialization
255- public Object next (VirtualFrame frame , PGenerator self ,
255+ Object next (VirtualFrame frame , PGenerator self ,
256256 @ Cached ResumeGeneratorNode resumeGeneratorNode ) {
257257 checkResumable (this , self );
258258 return resumeGeneratorNode .execute (frame , self , null );
@@ -264,7 +264,7 @@ public Object next(VirtualFrame frame, PGenerator self,
264264 public abstract static class SendNode extends PythonBuiltinNode {
265265
266266 @ Specialization
267- public Object send (VirtualFrame frame , PGenerator self , Object value ,
267+ Object send (VirtualFrame frame , PGenerator self , Object value ,
268268 @ Cached ResumeGeneratorNode resumeGeneratorNode ) {
269269 checkResumable (this , self );
270270 return resumeGeneratorNode .execute (frame , self , value );
@@ -280,19 +280,19 @@ abstract static class ThrowNode extends PythonBuiltinNode {
280280 @ Child private GetTracebackNode getTracebackNode ;
281281
282282 @ ImportStatic ({PGuards .class , SpecialMethodNames .class })
283- public abstract static class PrepareExceptionNode extends Node {
283+ abstract static class PrepareExceptionNode extends Node {
284284 public abstract PBaseException execute (VirtualFrame frame , Object type , Object value );
285285
286286 private PRaiseNode raiseNode ;
287287 private IsSubtypeNode isSubtypeNode ;
288288
289289 @ Specialization
290- PBaseException doException (PBaseException exc , @ SuppressWarnings ("unused" ) PNone value ) {
290+ static PBaseException doException (PBaseException exc , @ SuppressWarnings ("unused" ) PNone value ) {
291291 return exc ;
292292 }
293293
294294 @ 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 ,
296296 @ Cached PRaiseNode raise ) {
297297 throw raise .raise (PythonBuiltinClassType .TypeError , ErrorMessages .INSTANCE_EX_MAY_NOT_HAVE_SEP_VALUE );
298298 }
0 commit comments