@@ -31,10 +31,6 @@ def native_slot(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:
3131 return f"{ NATIVE_PREFIX } { fn .cname (emitter .names )} "
3232
3333
34- def wrapper_slot (cl : ClassIR , fn : FuncIR , emitter : Emitter ) -> str :
35- return f"{ PREFIX } { fn .cname (emitter .names )} "
36-
37-
3834# We maintain a table from dunder function names to struct slots they
3935# correspond to and functions that generate a wrapper (if necessary)
4036# and return the function name to stick in the slot.
@@ -137,12 +133,7 @@ def wrapper_slot(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:
137133
138134
139135def generate_call_wrapper (cl : ClassIR , fn : FuncIR , emitter : Emitter ) -> str :
140- if emitter .use_vectorcall ():
141- # Use vectorcall wrapper if supported (PEP 590).
142- return "PyVectorcall_Call"
143- else :
144- # On older Pythons use the legacy wrapper.
145- return wrapper_slot (cl , fn , emitter )
136+ return "PyVectorcall_Call"
146137
147138
148139def slot_key (attr : str ) -> str :
@@ -333,7 +324,7 @@ def emit_line() -> None:
333324 flags = ["Py_TPFLAGS_DEFAULT" , "Py_TPFLAGS_HEAPTYPE" , "Py_TPFLAGS_BASETYPE" ]
334325 if generate_full :
335326 flags .append ("Py_TPFLAGS_HAVE_GC" )
336- if cl .has_method ("__call__" ) and emitter . use_vectorcall () :
327+ if cl .has_method ("__call__" ):
337328 fields ["tp_vectorcall_offset" ] = "offsetof({}, vectorcall)" .format (
338329 cl .struct_name (emitter .names )
339330 )
@@ -381,7 +372,7 @@ def generate_object_struct(cl: ClassIR, emitter: Emitter) -> None:
381372 seen_attrs : set [tuple [str , RType ]] = set ()
382373 lines : list [str ] = []
383374 lines += ["typedef struct {" , "PyObject_HEAD" , "CPyVTableItem *vtable;" ]
384- if cl .has_method ("__call__" ) and emitter . use_vectorcall () :
375+ if cl .has_method ("__call__" ):
385376 lines .append ("vectorcallfunc vectorcall;" )
386377 bitmap_attrs = []
387378 for base in reversed (cl .base_mro ):
@@ -576,7 +567,7 @@ def generate_setup_for_class(
576567 field = emitter .bitmap_field (i )
577568 emitter .emit_line (f"self->{ field } = 0;" )
578569
579- if cl .has_method ("__call__" ) and emitter . use_vectorcall () :
570+ if cl .has_method ("__call__" ):
580571 name = cl .method_decl ("__call__" ).cname (emitter .names )
581572 emitter .emit_line (f"self->vectorcall = { PREFIX } { name } ;" )
582573
0 commit comments