mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-134584: Eliminate redundant refcounting from _BINARY_OP_SUBSCR_TUPLE_INT (GH-143094)
This commit is contained in:
parent
cbe0cb779a
commit
cc48bf0fde
9 changed files with 65 additions and 34 deletions
|
|
@ -975,9 +975,9 @@ dummy_func(
|
|||
}
|
||||
|
||||
macro(BINARY_OP_SUBSCR_TUPLE_INT) =
|
||||
_GUARD_TOS_INT + _GUARD_NOS_TUPLE + unused/5 + _BINARY_OP_SUBSCR_TUPLE_INT;
|
||||
_GUARD_TOS_INT + _GUARD_NOS_TUPLE + unused/5 + _BINARY_OP_SUBSCR_TUPLE_INT + _POP_TOP_INT + POP_TOP;
|
||||
|
||||
op(_BINARY_OP_SUBSCR_TUPLE_INT, (tuple_st, sub_st -- res)) {
|
||||
op(_BINARY_OP_SUBSCR_TUPLE_INT, (tuple_st, sub_st -- res, ts, ss)) {
|
||||
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
|
||||
PyObject *tuple = PyStackRef_AsPyObjectBorrow(tuple_st);
|
||||
|
||||
|
|
@ -991,9 +991,10 @@ dummy_func(
|
|||
STAT_INC(BINARY_OP, hit);
|
||||
PyObject *res_o = PyTuple_GET_ITEM(tuple, index);
|
||||
assert(res_o != NULL);
|
||||
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
|
||||
res = PyStackRef_FromPyObjectNew(res_o);
|
||||
DECREF_INPUTS();
|
||||
ts = tuple_st;
|
||||
ss = sub_st;
|
||||
INPUTS_DEAD();
|
||||
}
|
||||
|
||||
op(_GUARD_NOS_DICT, (nos, unused -- nos, unused)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue