71
71
import com .oracle .graal .python .builtins .objects .socket .PSocket ;
72
72
import com .oracle .graal .python .builtins .objects .str .PString ;
73
73
import com .oracle .graal .python .builtins .objects .tuple .PTuple ;
74
- import com .oracle .graal .python .builtins .objects .type .LazyPythonClass ;
75
74
import com .oracle .graal .python .nodes .ErrorMessages ;
76
75
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
77
76
import com .oracle .graal .python .nodes .function .PythonBuiltinNode ;
@@ -227,13 +226,13 @@ public void initialize(PythonCore core) {
227
226
@ GenerateNodeFactory
228
227
public abstract static class SocketNode extends PythonBuiltinNode {
229
228
@ Specialization (guards = {"isNoValue(family)" , "isNoValue(type)" , "isNoValue(proto)" , "isNoValue(fileno)" })
230
- Object socket (LazyPythonClass cls , @ SuppressWarnings ("unused" ) PNone family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto ,
229
+ Object socket (Object cls , @ SuppressWarnings ("unused" ) PNone family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto ,
231
230
@ SuppressWarnings ("unused" ) PNone fileno ) {
232
231
return createSocketInternal (cls , PSocket .AF_INET , PSocket .SOCK_STREAM , 0 );
233
232
}
234
233
235
234
@ Specialization (guards = {"isNoValue(family)" , "isNoValue(type)" , "isNoValue(proto)" , "!isNoValue(fileno)" })
236
- Object socket (VirtualFrame frame , LazyPythonClass cls , @ SuppressWarnings ("unused" ) PNone family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto , Object fileno ,
235
+ Object socket (VirtualFrame frame , Object cls , @ SuppressWarnings ("unused" ) PNone family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto , Object fileno ,
237
236
@ Cached CastToJavaIntExactNode cast ) {
238
237
try {
239
238
return createSocketInternal (frame , cls , -1 , -1 , -1 , cast .execute (fileno ));
@@ -243,7 +242,7 @@ Object socket(VirtualFrame frame, LazyPythonClass cls, @SuppressWarnings("unused
243
242
}
244
243
245
244
@ Specialization (guards = {"!isNoValue(family)" , "isNoValue(type)" , "isNoValue(proto)" , "isNoValue(fileno)" })
246
- Object socket (LazyPythonClass cls , Object family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ,
245
+ Object socket (Object cls , Object family , @ SuppressWarnings ("unused" ) PNone type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ,
247
246
@ Cached CastToJavaIntExactNode cast ) {
248
247
try {
249
248
return createSocketInternal (cls , cast .execute (family ), PSocket .SOCK_STREAM , 0 );
@@ -253,7 +252,7 @@ Object socket(LazyPythonClass cls, Object family, @SuppressWarnings("unused") PN
253
252
}
254
253
255
254
@ Specialization (guards = {"!isNoValue(family)" , "!isNoValue(type)" , "isNoValue(proto)" , "isNoValue(fileno)" })
256
- Object socket (LazyPythonClass cls , Object family , Object type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ,
255
+ Object socket (Object cls , Object family , Object type , @ SuppressWarnings ("unused" ) PNone proto , @ SuppressWarnings ("unused" ) PNone fileno ,
257
256
@ Cached CastToJavaIntExactNode cast ) {
258
257
try {
259
258
return createSocketInternal (cls , cast .execute (family ), cast .execute (type ), 0 );
@@ -263,7 +262,7 @@ Object socket(LazyPythonClass cls, Object family, Object type, @SuppressWarnings
263
262
}
264
263
265
264
@ Specialization (guards = {"!isNoValue(family)" , "!isNoValue(type)" , "!isNoValue(proto)" , "isNoValue(fileno)" })
266
- Object socket (LazyPythonClass cls , Object family , Object type , Object proto , @ SuppressWarnings ("unused" ) PNone fileno ,
265
+ Object socket (Object cls , Object family , Object type , Object proto , @ SuppressWarnings ("unused" ) PNone fileno ,
267
266
@ Cached CastToJavaIntExactNode cast ) {
268
267
try {
269
268
return createSocketInternal (cls , cast .execute (family ), cast .execute (type ), cast .execute (proto ));
@@ -273,7 +272,7 @@ Object socket(LazyPythonClass cls, Object family, Object type, Object proto, @Su
273
272
}
274
273
275
274
@ Specialization (guards = {"!isNoValue(family)" , "!isNoValue(type)" , "!isNoValue(proto)" , "!isNoValue(fileno)" })
276
- Object socket (VirtualFrame frame , LazyPythonClass cls , Object family , Object type , Object proto , Object fileno ,
275
+ Object socket (VirtualFrame frame , Object cls , Object family , Object type , Object proto , Object fileno ,
277
276
@ Cached CastToJavaIntExactNode cast ) {
278
277
try {
279
278
return createSocketInternal (frame , cls , cast .execute (family ), cast .execute (type ), cast .execute (proto ), cast .execute (fileno ));
@@ -282,7 +281,7 @@ Object socket(VirtualFrame frame, LazyPythonClass cls, Object family, Object typ
282
281
}
283
282
}
284
283
285
- private Object createSocketInternal (LazyPythonClass cls , int family , int type , int proto ) {
284
+ private Object createSocketInternal (Object cls , int family , int type , int proto ) {
286
285
if (getContext ().getEnv ().isNativeAccessAllowed ()) {
287
286
PSocket newSocket = factory ().createSocket (cls , family , type , proto );
288
287
int fd = getContext ().getResources ().openSocket (newSocket );
@@ -293,7 +292,7 @@ private Object createSocketInternal(LazyPythonClass cls, int family, int type, i
293
292
}
294
293
}
295
294
296
- private Object createSocketInternal (VirtualFrame frame , LazyPythonClass cls , int family , int type , int proto , int fileno ) {
295
+ private Object createSocketInternal (VirtualFrame frame , Object cls , int family , int type , int proto , int fileno ) {
297
296
if (getContext ().getEnv ().isNativeAccessAllowed ()) {
298
297
PSocket oldSocket = getContext ().getResources ().getSocket (fileno );
299
298
if (oldSocket == null ) {
0 commit comments