44
44
45
45
import com .oracle .graal .python .builtins .Builtin ;
46
46
import com .oracle .graal .python .builtins .CoreFunctions ;
47
+ import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
47
48
import com .oracle .graal .python .builtins .PythonBuiltins ;
48
49
import com .oracle .graal .python .builtins .objects .PNone ;
50
+ import com .oracle .graal .python .builtins .objects .type .PythonClass ;
49
51
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
50
52
import com .oracle .graal .python .nodes .function .PythonBuiltinNode ;
51
- import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
52
53
import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
53
54
import com .oracle .truffle .api .dsl .NodeFactory ;
54
55
import com .oracle .truffle .api .dsl .Specialization ;
@@ -61,13 +62,13 @@ protected List<? extends NodeFactory<? extends PythonBuiltinBaseNode>> getNodeFa
61
62
}
62
63
63
64
// socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None)
64
- @ Builtin (name = "socket" , minNumOfPositionalArgs = 0 , maxNumOfPositionalArgs = 4 , keywordArguments = {"family" , "type" , "proto" , "fileno" })
65
+ @ Builtin (name = "socket" , minNumOfPositionalArgs = 1 , maxNumOfPositionalArgs = 5 , keywordArguments = {"family" , "type" , "proto" , "fileno" },
66
+ constructsClass = PythonBuiltinClassType .PSocket )
65
67
@ GenerateNodeFactory
66
68
public abstract static class SocketNode extends PythonBuiltinNode {
67
- @ TruffleBoundary
68
69
@ Specialization
69
- Object socket (int family , int type , int proto , PNone fileno ) {
70
- return factory ().createSocket (family , type , proto );
70
+ Object socket (PythonClass cls , int family , int type , int proto , PNone fileno ) {
71
+ return factory ().createSocket (cls , family , type , proto );
71
72
}
72
73
}
73
74
}
0 commit comments