mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-139525: Don't specialize functions which have a modified vectorcall (#139524)
Don't specialize functions which have a modified vectorcall
This commit is contained in:
parent
12805ef9da
commit
ff0cf0af10
3 changed files with 37 additions and 0 deletions
|
|
@ -630,6 +630,7 @@ _PyCode_Quicken(_Py_CODEUNIT *instructions, Py_ssize_t size, int enable_counters
|
|||
#define SPEC_FAIL_CALL_INIT_NOT_PYTHON 21
|
||||
#define SPEC_FAIL_CALL_PEP_523 22
|
||||
#define SPEC_FAIL_CALL_BOUND_METHOD 23
|
||||
#define SPEC_FAIL_CALL_VECTORCALL 24
|
||||
#define SPEC_FAIL_CALL_CLASS_MUTABLE 26
|
||||
#define SPEC_FAIL_CALL_METHOD_WRAPPER 28
|
||||
#define SPEC_FAIL_CALL_OPERATOR_WRAPPER 29
|
||||
|
|
@ -2071,6 +2072,10 @@ specialize_py_call(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs,
|
|||
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_PEP_523);
|
||||
return -1;
|
||||
}
|
||||
if (func->vectorcall != _PyFunction_Vectorcall) {
|
||||
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_VECTORCALL);
|
||||
return -1;
|
||||
}
|
||||
int argcount = -1;
|
||||
if (kind == SPEC_FAIL_CODE_NOT_OPTIMIZED) {
|
||||
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CODE_NOT_OPTIMIZED);
|
||||
|
|
@ -2110,6 +2115,10 @@ specialize_py_call_kw(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs,
|
|||
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_PEP_523);
|
||||
return -1;
|
||||
}
|
||||
if (func->vectorcall != _PyFunction_Vectorcall) {
|
||||
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_VECTORCALL);
|
||||
return -1;
|
||||
}
|
||||
if (kind == SPEC_FAIL_CODE_NOT_OPTIMIZED) {
|
||||
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CODE_NOT_OPTIMIZED);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue