mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Revert "gh-133395: add option for extension modules to specialize BINARY_OP/SUBSCR, apply to arrays (#133396)" (#133498)
This commit is contained in:
parent
3c73cf51df
commit
296cd128bf
14 changed files with 44 additions and 171 deletions
|
@ -801,19 +801,9 @@ dummy_func(
|
|||
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
|
||||
_PyBinaryOpSpecializationDescr *d = (_PyBinaryOpSpecializationDescr*)descr;
|
||||
assert(INLINE_CACHE_ENTRIES_BINARY_OP == 5);
|
||||
assert(d);
|
||||
assert(d->guard);
|
||||
assert(d && d->guard);
|
||||
int res = d->guard(left_o, right_o);
|
||||
ERROR_IF(res < 0);
|
||||
if (res == 0) {
|
||||
if (d->free) {
|
||||
d->free(d);
|
||||
}
|
||||
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)(this_instr+1);
|
||||
write_ptr(cache->external_cache, NULL);
|
||||
this_instr->op.code = BINARY_OP;
|
||||
DEOPT_IF(true);
|
||||
}
|
||||
DEOPT_IF(!res);
|
||||
}
|
||||
|
||||
pure op(_BINARY_OP_EXTEND, (descr/4, left, right -- res)) {
|
||||
|
@ -826,7 +816,6 @@ dummy_func(
|
|||
|
||||
PyObject *res_o = d->action(left_o, right_o);
|
||||
DECREF_INPUTS();
|
||||
ERROR_IF(res_o == NULL);
|
||||
res = PyStackRef_FromPyObjectSteal(res_o);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue