gh-134584: Eliminate redundant refcounting from _STORE_SUBSCR_LIST_INT (gh-142703)

This commit is contained in:
Donghee Na 2025-12-14 21:26:00 +09:00 committed by GitHub
parent af7cca3c39
commit 04da416e6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 96 additions and 21 deletions

View file

@ -1126,9 +1126,9 @@ dummy_func(
macro(STORE_SUBSCR) = _SPECIALIZE_STORE_SUBSCR + _STORE_SUBSCR;
macro(STORE_SUBSCR_LIST_INT) =
_GUARD_TOS_INT + _GUARD_NOS_LIST + unused/1 + _STORE_SUBSCR_LIST_INT;
_GUARD_TOS_INT + _GUARD_NOS_LIST + unused/1 + _STORE_SUBSCR_LIST_INT + _POP_TOP_INT + POP_TOP;
op(_STORE_SUBSCR_LIST_INT, (value, list_st, sub_st -- )) {
op(_STORE_SUBSCR_LIST_INT, (value, list_st, sub_st -- ls, ss)) {
PyObject *sub = PyStackRef_AsPyObjectBorrow(sub_st);
PyObject *list = PyStackRef_AsPyObjectBorrow(list_st);
@ -1151,9 +1151,9 @@ dummy_func(
PyStackRef_AsPyObjectSteal(value));
assert(old_value != NULL);
UNLOCK_OBJECT(list); // unlock before decrefs!
PyStackRef_CLOSE_SPECIALIZED(sub_st, _PyLong_ExactDealloc);
DEAD(sub_st);
PyStackRef_CLOSE(list_st);
INPUTS_DEAD();
ls = list_st;
ss = sub_st;
Py_DECREF(old_value);
}