gh-143092: Make CALL_LIST_APPEND and BINARY_OP_INPLACE_ADD_UNICODE normal instructions (GH-143124)

These super instructions need many special cases in the interpreter, specializer, and JIT. It's best we convert them to normal instructions.
This commit is contained in:
Ken Jin 2025-12-25 06:03:00 +08:00 committed by GitHub
parent 594a4631c3
commit cf6758ff9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 167 additions and 205 deletions

View file

@ -1623,10 +1623,8 @@ specialize_method_descriptor(PyMethodDescrObject *descr, PyObject *self_or_null,
}
PyInterpreterState *interp = _PyInterpreterState_GET();
PyObject *list_append = interp->callable_cache.list_append;
_Py_CODEUNIT next = instr[INLINE_CACHE_ENTRIES_CALL + 1];
bool pop = (next.op.code == POP_TOP);
int oparg = instr->op.arg;
if ((PyObject *)descr == list_append && oparg == 1 && pop) {
if ((PyObject *)descr == list_append && oparg == 1) {
assert(self_or_null != NULL);
if (PyList_CheckExact(self_or_null)) {
specialize(instr, CALL_LIST_APPEND);