diff options
author | Petr Viktorin <encukou@gmail.com> | 2020-02-11 16:46:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 16:46:57 (GMT) |
commit | ffd9753a944916ced659b2c77aebe66a6c9fbab5 (patch) | |
tree | f3469bdca81c102afa811a39dd3eaa9643287e93 /Python/ceval.c | |
parent | f3e7ea5b8c220cd63101e419d529c8563f9c6115 (diff) | |
download | cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.zip cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.gz cpython-ffd9753a944916ced659b2c77aebe66a6c9fbab5.tar.bz2 |
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
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index deba99e..eb0f131 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1874,7 +1874,7 @@ main_loop: 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 @@ main_loop: 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)); |