Skip to content

Commit 20e8f93

Browse files
committed
Disable specialization
1 parent cf94296 commit 20e8f93

1 file changed

Lines changed: 2 additions & 37 deletions

File tree

Python/specialize.c

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,43 +2113,8 @@ specialize_c_call(PyObject *callable, _Py_CODEUNIT *instr, int nargs)
21132113
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_OTHER);
21142114
return 1;
21152115
}
2116-
switch (PyCFunction_GET_FLAGS(callable) &
2117-
(METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O |
2118-
METH_KEYWORDS | METH_METHOD)) {
2119-
case METH_O: {
2120-
if (nargs != 1) {
2121-
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_WRONG_NUMBER_ARGUMENTS);
2122-
return 1;
2123-
}
2124-
/* len(o) */
2125-
PyInterpreterState *interp = _PyInterpreterState_GET();
2126-
if (callable == interp->callable_cache.len) {
2127-
specialize(instr, CALL_LEN);
2128-
return 0;
2129-
}
2130-
specialize(instr, CALL_BUILTIN_O);
2131-
return 0;
2132-
}
2133-
case METH_FASTCALL: {
2134-
if (nargs == 2) {
2135-
/* isinstance(o1, o2) */
2136-
PyInterpreterState *interp = _PyInterpreterState_GET();
2137-
if (callable == interp->callable_cache.isinstance) {
2138-
specialize(instr, CALL_ISINSTANCE);
2139-
return 0;
2140-
}
2141-
}
2142-
specialize(instr, CALL_BUILTIN_FAST);
2143-
return 0;
2144-
}
2145-
case METH_FASTCALL | METH_KEYWORDS: {
2146-
specialize(instr, CALL_BUILTIN_FAST_WITH_KEYWORDS);
2147-
return 0;
2148-
}
2149-
default:
2150-
specialize(instr, CALL_NON_PY_GENERAL);
2151-
return 0;
2152-
}
2116+
specialize(instr, CALL_NON_PY_GENERAL);
2117+
return 0;
21532118
}
21542119

21552120
void

0 commit comments

Comments
 (0)