@@ -239,7 +239,7 @@ protected abstract static class CreateByteOrByteArrayNode extends PythonBuiltinN
239
239
@ Child private IsBuiltinClassProfile isClassProfile = IsBuiltinClassProfile .create ();
240
240
241
241
@ SuppressWarnings ("unused" )
242
- protected Object create (LazyPythonClass cls , byte [] barr ) {
242
+ protected Object create (Object cls , byte [] barr ) {
243
243
throw new IllegalStateException ("should not reach" );
244
244
}
245
245
@@ -320,7 +320,7 @@ private static byte[] resize(byte[] arr, int len) {
320
320
@ GenerateNodeFactory
321
321
public abstract static class BytesNode extends CreateByteOrByteArrayNode {
322
322
@ Override
323
- protected final Object create (LazyPythonClass cls , byte [] barr ) {
323
+ protected final Object create (Object cls , byte [] barr ) {
324
324
return factory ().createBytes (cls , barr );
325
325
}
326
326
}
@@ -331,7 +331,7 @@ protected final Object create(LazyPythonClass cls, byte[] barr) {
331
331
@ TypeSystemReference (PythonArithmeticTypes .class )
332
332
public abstract static class ByteArrayNode extends CreateByteOrByteArrayNode {
333
333
@ Override
334
- protected final Object create (LazyPythonClass cls , byte [] barr ) {
334
+ protected final Object create (Object cls , byte [] barr ) {
335
335
return factory ().createByteArray (cls , barr );
336
336
}
337
337
}
@@ -350,14 +350,14 @@ public abstract static class ComplexNode extends PythonBuiltinNode {
350
350
@ Child private IsBuiltinClassProfile isPrimitiveProfile = IsBuiltinClassProfile .create ();
351
351
@ Child private IsBuiltinClassProfile isComplexTypeProfile ;
352
352
353
- private PComplex createComplex (LazyPythonClass cls , double real , double imaginary ) {
353
+ private PComplex createComplex (Object cls , double real , double imaginary ) {
354
354
if (isPrimitiveProfile .profileClass (cls , PythonBuiltinClassType .PComplex )) {
355
355
return factory ().createComplex (real , imaginary );
356
356
}
357
357
return factory ().createComplex (cls , real , imaginary );
358
358
}
359
359
360
- private PComplex createComplex (LazyPythonClass cls , PComplex value ) {
360
+ private PComplex createComplex (Object cls , PComplex value ) {
361
361
if (isPrimitiveProfile .profileClass (cls , PythonBuiltinClassType .PComplex )) {
362
362
return value ;
363
363
}
@@ -779,7 +779,7 @@ public static int endDouble(String string, int s) {
779
779
public abstract static class DictionaryNode extends PythonBuiltinNode {
780
780
@ Specialization
781
781
@ SuppressWarnings ("unused" )
782
- public PDict dictEmpty (LazyPythonClass cls , Object [] args , PKeyword [] keywordArgs ) {
782
+ public PDict dictEmpty (Object cls , Object [] args , PKeyword [] keywordArgs ) {
783
783
return factory ().createDict (cls );
784
784
}
785
785
}
@@ -1097,12 +1097,12 @@ public abstract static class FrozenSetNode extends PythonBuiltinNode {
1097
1097
@ Child private HashingCollectionNodes .SetItemNode setItemNode ;
1098
1098
1099
1099
@ Specialization (guards = "isNoValue(arg)" )
1100
- public PFrozenSet frozensetEmpty (LazyPythonClass cls , @ SuppressWarnings ("unused" ) PNone arg ) {
1100
+ public PFrozenSet frozensetEmpty (Object cls , @ SuppressWarnings ("unused" ) PNone arg ) {
1101
1101
return factory ().createFrozenSet (cls );
1102
1102
}
1103
1103
1104
1104
@ Specialization
1105
- public PFrozenSet frozenset (VirtualFrame frame , LazyPythonClass cls , String arg ) {
1105
+ public PFrozenSet frozenset (VirtualFrame frame , Object cls , String arg ) {
1106
1106
PFrozenSet frozenSet = factory ().createFrozenSet (cls );
1107
1107
for (int i = 0 ; i < PString .length (arg ); i ++) {
1108
1108
getSetItemNode ().execute (frame , frozenSet , PString .valueOf (PString .charAt (arg , i )), PNone .NONE );
@@ -1111,7 +1111,7 @@ public PFrozenSet frozenset(VirtualFrame frame, LazyPythonClass cls, String arg)
1111
1111
}
1112
1112
1113
1113
@ Specialization (guards = "!isNoValue(iterable)" )
1114
- public PFrozenSet frozensetIterable (VirtualFrame frame , LazyPythonClass cls , Object iterable ,
1114
+ public PFrozenSet frozensetIterable (VirtualFrame frame , Object cls , Object iterable ,
1115
1115
@ Cached ("create()" ) GetIteratorNode getIterator ,
1116
1116
@ Cached ("create()" ) GetNextNode next ,
1117
1117
@ Cached ("create()" ) IsBuiltinClassProfile errorProfile ) {
@@ -1999,7 +1999,7 @@ public PTuple tupleObject(Object cls, @SuppressWarnings("unused") Object arg) {
1999
1999
@ GenerateNodeFactory
2000
2000
public abstract static class ZipNode extends PythonBuiltinNode {
2001
2001
@ Specialization
2002
- PZip zip (VirtualFrame frame , LazyPythonClass cls , Object [] args ,
2002
+ PZip zip (VirtualFrame frame , Object cls , Object [] args ,
2003
2003
@ Cached ("create()" ) GetIteratorNode getIterator ) {
2004
2004
Object [] iterables = new Object [args .length ];
2005
2005
for (int i = 0 ; i < args .length ; i ++) {
@@ -2268,7 +2268,7 @@ private PythonClass typeMetaclass(VirtualFrame frame, String name, PTuple bases,
2268
2268
// __class_getitem__: if they are plain functions, make them
2269
2269
// classmethods
2270
2270
if (value instanceof PFunction ) {
2271
- pythonClass .setAttribute (key , factory ().createClassmethod (value ));
2271
+ pythonClass .setAttribute (key , factory ().createClassmethodFromCallableObj (value ));
2272
2272
} else {
2273
2273
pythonClass .setAttribute (key , value );
2274
2274
}
@@ -2780,17 +2780,17 @@ public Object generator(Object args, Object kwargs) {
2780
2780
@ GenerateNodeFactory
2781
2781
public abstract static class MethodTypeNode extends PythonTernaryBuiltinNode {
2782
2782
@ Specialization
2783
- Object method (LazyPythonClass cls , PFunction func , Object self ) {
2783
+ Object method (Object cls , PFunction func , Object self ) {
2784
2784
return factory ().createMethod (cls , self , func );
2785
2785
}
2786
2786
2787
2787
@ Specialization
2788
- Object methodBuiltin (@ SuppressWarnings ("unused" ) LazyPythonClass cls , PBuiltinFunction func , Object self ) {
2788
+ Object methodBuiltin (@ SuppressWarnings ("unused" ) Object cls , PBuiltinFunction func , Object self ) {
2789
2789
return factory ().createMethod (self , func );
2790
2790
}
2791
2791
2792
2792
@ Specialization
2793
- Object methodGeneric (VirtualFrame frame , @ SuppressWarnings ("unused" ) LazyPythonClass cls , Object func , Object self ,
2793
+ Object methodGeneric (VirtualFrame frame , @ SuppressWarnings ("unused" ) Object cls , Object func , Object self ,
2794
2794
@ CachedLibrary (limit = "3" ) PythonObjectLibrary dataModelLibrary ) {
2795
2795
PythonContext context = getContextRef ().get ();
2796
2796
Object state = IndirectCallContext .enter (frame , context , this );
@@ -2810,7 +2810,7 @@ Object methodGeneric(VirtualFrame frame, @SuppressWarnings("unused") LazyPythonC
2810
2810
@ GenerateNodeFactory
2811
2811
public abstract static class BuiltinMethodTypeNode extends PythonBuiltinNode {
2812
2812
@ Specialization
2813
- Object method (LazyPythonClass cls , Object self , PBuiltinFunction func ) {
2813
+ Object method (Object cls , Object self , PBuiltinFunction func ) {
2814
2814
return factory ().createBuiltinMethod (cls , self , func );
2815
2815
}
2816
2816
}
@@ -2966,12 +2966,12 @@ Object call() {
2966
2966
@ GenerateNodeFactory
2967
2967
public abstract static class BaseExceptionNode extends PythonBuiltinNode {
2968
2968
@ Specialization (guards = "args.length == 0" )
2969
- Object initNoArgs (LazyPythonClass cls , @ SuppressWarnings ("unused" ) Object [] args , @ SuppressWarnings ("unused" ) PKeyword [] kwargs ) {
2969
+ Object initNoArgs (Object cls , @ SuppressWarnings ("unused" ) Object [] args , @ SuppressWarnings ("unused" ) PKeyword [] kwargs ) {
2970
2970
return factory ().createBaseException (cls );
2971
2971
}
2972
2972
2973
2973
@ Specialization (guards = "args.length != 0" )
2974
- Object initArgs (LazyPythonClass cls , Object [] args , @ SuppressWarnings ("unused" ) PKeyword [] kwargs ) {
2974
+ Object initArgs (Object cls , Object [] args , @ SuppressWarnings ("unused" ) PKeyword [] kwargs ) {
2975
2975
return factory ().createBaseException (cls , factory ().createTuple (args ));
2976
2976
}
2977
2977
}
@@ -3128,7 +3128,7 @@ public boolean hasSetItem(Object object) {
3128
3128
@ GenerateNodeFactory
3129
3129
public abstract static class MemoryViewNode extends PythonBuiltinNode {
3130
3130
@ Specialization
3131
- public PMemoryView doGeneric (LazyPythonClass cls , Object value ) {
3131
+ public PMemoryView doGeneric (Object cls , Object value ) {
3132
3132
return factory ().createMemoryView (cls , value );
3133
3133
}
3134
3134
}
@@ -3138,7 +3138,7 @@ public PMemoryView doGeneric(LazyPythonClass cls, Object value) {
3138
3138
@ GenerateNodeFactory
3139
3139
public abstract static class SuperInitNode extends PythonTernaryBuiltinNode {
3140
3140
@ Specialization
3141
- Object doObjectIndirect (LazyPythonClass self , @ SuppressWarnings ("unused" ) Object type , @ SuppressWarnings ("unused" ) Object object ) {
3141
+ Object doObjectIndirect (Object self , @ SuppressWarnings ("unused" ) Object type , @ SuppressWarnings ("unused" ) Object object ) {
3142
3142
return factory ().createSuperObject (self );
3143
3143
}
3144
3144
}
@@ -3166,7 +3166,7 @@ Object doObjectIndirect(LazyPythonClass self, @SuppressWarnings("unused") Object
3166
3166
@ GenerateNodeFactory
3167
3167
public abstract static class ClassmethodNode extends PythonBinaryBuiltinNode {
3168
3168
@ Specialization
3169
- Object doObjectIndirect (LazyPythonClass self , @ SuppressWarnings ("unused" ) Object callable ) {
3169
+ Object doObjectIndirect (Object self , @ SuppressWarnings ("unused" ) Object callable ) {
3170
3170
return factory ().createClassmethod (self );
3171
3171
}
3172
3172
}
@@ -3175,7 +3175,7 @@ Object doObjectIndirect(LazyPythonClass self, @SuppressWarnings("unused") Object
3175
3175
@ GenerateNodeFactory
3176
3176
public abstract static class StaticmethodNode extends PythonBinaryBuiltinNode {
3177
3177
@ Specialization
3178
- Object doObjectIndirect (LazyPythonClass self , @ SuppressWarnings ("unused" ) Object callable ) {
3178
+ Object doObjectIndirect (Object self , @ SuppressWarnings ("unused" ) Object callable ) {
3179
3179
return factory ().createStaticmethod (self );
3180
3180
}
3181
3181
}
@@ -3184,7 +3184,7 @@ Object doObjectIndirect(LazyPythonClass self, @SuppressWarnings("unused") Object
3184
3184
@ GenerateNodeFactory
3185
3185
public abstract static class MapNode extends PythonVarargsBuiltinNode {
3186
3186
@ Specialization
3187
- PMap doit (LazyPythonClass self , @ SuppressWarnings ("unused" ) Object [] args , @ SuppressWarnings ("unused" ) PKeyword [] keywords ) {
3187
+ PMap doit (Object self , @ SuppressWarnings ("unused" ) Object [] args , @ SuppressWarnings ("unused" ) PKeyword [] keywords ) {
3188
3188
return factory ().createMap (self );
3189
3189
}
3190
3190
}
0 commit comments