@@ -31,10 +31,6 @@ def native_slot(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:
31
31
return f"{ NATIVE_PREFIX } { fn .cname (emitter .names )} "
32
32
33
33
34
- def wrapper_slot (cl : ClassIR , fn : FuncIR , emitter : Emitter ) -> str :
35
- return f"{ PREFIX } { fn .cname (emitter .names )} "
36
-
37
-
38
34
# We maintain a table from dunder function names to struct slots they
39
35
# correspond to and functions that generate a wrapper (if necessary)
40
36
# and return the function name to stick in the slot.
@@ -137,12 +133,7 @@ def wrapper_slot(cl: ClassIR, fn: FuncIR, emitter: Emitter) -> str:
137
133
138
134
139
135
def 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"
146
137
147
138
148
139
def slot_key (attr : str ) -> str :
@@ -333,7 +324,7 @@ def emit_line() -> None:
333
324
flags = ["Py_TPFLAGS_DEFAULT" , "Py_TPFLAGS_HEAPTYPE" , "Py_TPFLAGS_BASETYPE" ]
334
325
if generate_full :
335
326
flags .append ("Py_TPFLAGS_HAVE_GC" )
336
- if cl .has_method ("__call__" ) and emitter . use_vectorcall () :
327
+ if cl .has_method ("__call__" ):
337
328
fields ["tp_vectorcall_offset" ] = "offsetof({}, vectorcall)" .format (
338
329
cl .struct_name (emitter .names )
339
330
)
@@ -381,7 +372,7 @@ def generate_object_struct(cl: ClassIR, emitter: Emitter) -> None:
381
372
seen_attrs : set [tuple [str , RType ]] = set ()
382
373
lines : list [str ] = []
383
374
lines += ["typedef struct {" , "PyObject_HEAD" , "CPyVTableItem *vtable;" ]
384
- if cl .has_method ("__call__" ) and emitter . use_vectorcall () :
375
+ if cl .has_method ("__call__" ):
385
376
lines .append ("vectorcallfunc vectorcall;" )
386
377
bitmap_attrs = []
387
378
for base in reversed (cl .base_mro ):
@@ -576,7 +567,7 @@ def generate_setup_for_class(
576
567
field = emitter .bitmap_field (i )
577
568
emitter .emit_line (f"self->{ field } = 0;" )
578
569
579
- if cl .has_method ("__call__" ) and emitter . use_vectorcall () :
570
+ if cl .has_method ("__call__" ):
580
571
name = cl .method_decl ("__call__" ).cname (emitter .names )
581
572
emitter .emit_line (f"self->vectorcall = { PREFIX } { name } ;" )
582
573
0 commit comments