GH-131798: Split up and optimize CALL_ISINSTANCE (GH-133339)

This commit is contained in:
Tomas R. 2025-05-08 23:26:30 +02:00 committed by GitHub
parent b2fabce6ab
commit c492ac7252
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 392 additions and 301 deletions

View file

@ -2158,7 +2158,7 @@ specialize_c_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs)
if (nargs == 2) {
/* isinstance(o1, o2) */
PyInterpreterState *interp = _PyInterpreterState_GET();
if (callable == interp->callable_cache.isinstance) {
if (callable == interp->callable_cache.isinstance && instr->op.arg == 2) {
specialize(instr, CALL_ISINSTANCE);
return 0;
}