gh-106023: Remove _PyObject_FastCallTstate() function (#106273)

This commit is contained in:
Victor Stinner 2023-06-30 12:28:59 +02:00 committed by GitHub
parent f3cf2ddd8d
commit 80b3d8f337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 30 deletions

View file

@ -979,12 +979,6 @@ static PyObject *
call_trampoline(PyThreadState *tstate, PyObject* callback,
PyFrameObject *frame, int what, PyObject *arg)
{
PyObject *stack[3];
stack[0] = (PyObject *)frame;
stack[1] = whatstrings[what];
stack[2] = (arg != NULL) ? arg : Py_None;
/* Discard any previous modifications the frame's fast locals */
if (frame->f_fast_as_locals) {
if (PyFrame_FastToLocalsWithError(frame) < 0) {
@ -993,7 +987,11 @@ call_trampoline(PyThreadState *tstate, PyObject* callback,
}
/* call the Python-level function */
PyObject *result = _PyObject_FastCallTstate(tstate, callback, stack, 3);
if (arg == NULL) {
arg = Py_None;
}
PyObject *args[3] = {(PyObject *)frame, whatstrings[what], arg};
PyObject *result = _PyObject_VectorcallTstate(tstate, callback, args, 3, NULL);
PyFrame_LocalsToFast(frame, 1);
return result;