mirror of
https://github.com/python/cpython.git
synced 2025-10-25 18:54:53 +00:00
bpo-39245: Switch to public API for Vectorcall (GH-18460)
The bulk of this patch was generated automatically with:
for name in \
PyObject_Vectorcall \
Py_TPFLAGS_HAVE_VECTORCALL \
PyObject_VectorcallMethod \
PyVectorcall_Function \
PyObject_CallOneArg \
PyObject_CallMethodNoArgs \
PyObject_CallMethodOneArg \
;
do
echo $name
git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g"
done
old=_PyObject_FastCallDict
new=PyObject_VectorcallDict
git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g"
and then cleaned up:
- Revert changes to in docs & news
- Revert changes to backcompat defines in headers
- Nudge misaligned comments
This commit is contained in:
parent
f3e7ea5b8c
commit
ffd9753a94
56 changed files with 194 additions and 194 deletions
|
|
@ -1874,7 +1874,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
|
|||
Py_DECREF(value);
|
||||
goto error;
|
||||
}
|
||||
res = _PyObject_CallOneArg(hook, value);
|
||||
res = PyObject_CallOneArg(hook, value);
|
||||
Py_DECREF(value);
|
||||
if (res == NULL)
|
||||
goto error;
|
||||
|
|
@ -3271,7 +3271,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
|
|||
assert(!PyLong_Check(exc));
|
||||
exit_func = PEEK(7);
|
||||
PyObject *stack[4] = {NULL, exc, val, tb};
|
||||
res = _PyObject_Vectorcall(exit_func, stack + 1,
|
||||
res = PyObject_Vectorcall(exit_func, stack + 1,
|
||||
3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
||||
if (res == NULL)
|
||||
goto error;
|
||||
|
|
@ -4846,7 +4846,7 @@ trace_call_function(PyThreadState *tstate,
|
|||
{
|
||||
PyObject *x;
|
||||
if (PyCFunction_Check(func)) {
|
||||
C_TRACE(x, _PyObject_Vectorcall(func, args, nargs, kwnames));
|
||||
C_TRACE(x, PyObject_Vectorcall(func, args, nargs, kwnames));
|
||||
return x;
|
||||
}
|
||||
else if (Py_TYPE(func) == &PyMethodDescr_Type && nargs > 0) {
|
||||
|
|
@ -4862,13 +4862,13 @@ trace_call_function(PyThreadState *tstate,
|
|||
if (func == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
C_TRACE(x, _PyObject_Vectorcall(func,
|
||||
C_TRACE(x, PyObject_Vectorcall(func,
|
||||
args+1, nargs-1,
|
||||
kwnames));
|
||||
Py_DECREF(func);
|
||||
return x;
|
||||
}
|
||||
return _PyObject_Vectorcall(func, args, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames);
|
||||
return PyObject_Vectorcall(func, args, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames);
|
||||
}
|
||||
|
||||
/* Issue #29227: Inline call_function() into _PyEval_EvalFrameDefault()
|
||||
|
|
@ -4887,7 +4887,7 @@ call_function(PyThreadState *tstate, PyObject ***pp_stack, Py_ssize_t oparg, PyO
|
|||
x = trace_call_function(tstate, func, stack, nargs, kwnames);
|
||||
}
|
||||
else {
|
||||
x = _PyObject_Vectorcall(func, stack, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames);
|
||||
x = PyObject_Vectorcall(func, stack, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames);
|
||||
}
|
||||
|
||||
assert((x != NULL) ^ (_PyErr_Occurred(tstate) != NULL));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue