gh-134584: Eliminate redundant refcounting from _BINARY_OP_SUBSCR_LIST_INT (GH-142926)

This commit is contained in:
LloydZ 2025-12-19 02:25:36 +08:00 committed by GitHub
parent f54d44d333
commit 33d94abafd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 74 additions and 38 deletions

View file

@ -893,9 +893,9 @@ dummy_func(
macro(STORE_SLICE) = _SPECIALIZE_STORE_SLICE + _STORE_SLICE;
macro(BINARY_OP_SUBSCR_LIST_INT) =
_GUARD_TOS_INT + _GUARD_NOS_LIST + unused/5 + _BINARY_OP_SUBSCR_LIST_INT;
_GUARD_TOS_INT + _GUARD_NOS_LIST + unused/5 + _BINARY_OP_SUBSCR_LIST_INT + _POP_TOP_INT + POP_TOP;
op(_BINARY_OP_SUBSCR_LIST_INT, (list_st, sub_st -- res)) {
op(_BINARY_OP_SUBSCR_LIST_INT, (list_st, sub_st -- res, ls, ss)) {
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
PyObject *list = PyStackRef_AsPyObjectBorrow(list_st);
@ -918,7 +918,9 @@ dummy_func(
res = PyStackRef_FromPyObjectNew(res_o);
#endif
STAT_INC(BINARY_OP, hit);
DECREF_INPUTS();
ls = list_st;
ss = sub_st;
INPUTS_DEAD();
}
macro(BINARY_OP_SUBSCR_LIST_SLICE) =