gh-141367: Use CALL_LIST_APPEND instruction only for lists, not for list subclasses (GH-141398)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
Mikhail Efimov
2025-11-15 00:38:39 +03:00
committed by GitHub
parent f26ed455d5
commit 1281be1caf
7 changed files with 44 additions and 20 deletions

View File

@@ -3689,7 +3689,7 @@ dummy_func(
#if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_Py_Specialize_Call(callable, next_instr, oparg + !PyStackRef_IsNull(self_or_null));
_Py_Specialize_Call(callable, self_or_null, next_instr, oparg + !PyStackRef_IsNull(self_or_null));
DISPATCH_SAME_OPARG();
}
OPCODE_DEFERRED_INC(CALL);
@@ -4395,7 +4395,6 @@ dummy_func(
assert(oparg == 1);
PyObject *self_o = PyStackRef_AsPyObjectBorrow(self);
DEOPT_IF(!PyList_CheckExact(self_o));
DEOPT_IF(!LOCK_OBJECT(self_o));
STAT_INC(CALL, hit);
int err = _PyList_AppendTakeRef((PyListObject *)self_o, PyStackRef_AsPyObjectSteal(arg));