@@ -113,7 +113,6 @@ static PyObject * call_function(PyObject ***, int, uint64*, uint64*);
113113#else
114114static PyObject * call_function (PyObject * * * , int );
115115#endif
116- static PyObject * fast_function (PyObject * , PyObject * * , Py_ssize_t , Py_ssize_t );
117116static PyObject * do_call (PyObject * , PyObject * * * , Py_ssize_t , Py_ssize_t );
118117static PyObject * ext_do_call (PyObject * , PyObject * * * , int , Py_ssize_t , Py_ssize_t );
119118static PyObject * update_keyword_args (PyObject * , Py_ssize_t , PyObject * * * ,
@@ -4767,7 +4766,7 @@ call_function(PyObject ***pp_stack, int oparg
47674766 }
47684767 READ_TIMESTAMP (* pintr0 );
47694768 if (PyFunction_Check (func )) {
4770- x = fast_function (func , (* pp_stack ) - n , nargs , nkwargs );
4769+ x = _PyFunction_FastCallKeywords (func , (* pp_stack ) - n , nargs , nkwargs );
47714770 }
47724771 else {
47734772 x = do_call (func , pp_stack , nargs , nkwargs );
@@ -4780,7 +4779,7 @@ call_function(PyObject ***pp_stack, int oparg
47804779
47814780 /* Clear the stack of the function object. Also removes
47824781 the arguments in case they weren't consumed already
4783- (fast_function () and err_args() leave them on the stack).
4782+ (_PyFunction_FastCallKeywords () and err_args() leave them on the stack).
47844783 */
47854784 while ((* pp_stack ) > pfunc ) {
47864785 w = EXT_POP (* pp_stack );
@@ -4792,7 +4791,7 @@ call_function(PyObject ***pp_stack, int oparg
47924791 return x ;
47934792}
47944793
4795- /* The fast_function () function optimize calls for which no argument
4794+ /* The _PyFunction_FastCallKeywords () function optimize calls for which no argument
47964795 tuple is necessary; the objects are passed directly from the stack.
47974796 For the simplest case -- a function that takes only positional
47984797 arguments and is called with only positional arguments -- it
@@ -4840,8 +4839,9 @@ _PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t nargs,
48404839
48414840/* Similar to _PyFunction_FastCall() but keywords are passed a (key, value)
48424841 pairs in stack */
4843- static PyObject *
4844- fast_function (PyObject * func , PyObject * * stack , Py_ssize_t nargs , Py_ssize_t nkwargs )
4842+ PyObject *
4843+ _PyFunction_FastCallKeywords (PyObject * func , PyObject * * stack ,
4844+ Py_ssize_t nargs , Py_ssize_t nkwargs )
48454845{
48464846 PyCodeObject * co = (PyCodeObject * )PyFunction_GET_CODE (func );
48474847 PyObject * globals = PyFunction_GET_GLOBALS (func );
@@ -4850,6 +4850,11 @@ fast_function(PyObject *func, PyObject **stack, Py_ssize_t nargs, Py_ssize_t nkw
48504850 PyObject * * d ;
48514851 int nd ;
48524852
4853+ assert (func != NULL );
4854+ assert (nargs >= 0 );
4855+ assert (nkwargs >= 0 );
4856+ assert ((nargs == 0 && nkwargs == 0 ) || stack != NULL );
4857+
48534858 PCALL (PCALL_FUNCTION );
48544859 PCALL (PCALL_FAST_FUNCTION );
48554860
@@ -4902,14 +4907,14 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
49024907 Py_ssize_t nd , nk ;
49034908 PyObject * result ;
49044909
4905- PCALL (PCALL_FUNCTION );
4906- PCALL (PCALL_FAST_FUNCTION );
4907-
49084910 assert (func != NULL );
49094911 assert (nargs >= 0 );
49104912 assert (nargs == 0 || args != NULL );
49114913 assert (kwargs == NULL || PyDict_Check (kwargs ));
49124914
4915+ PCALL (PCALL_FUNCTION );
4916+ PCALL (PCALL_FAST_FUNCTION );
4917+
49134918 if (co -> co_kwonlyargcount == 0 &&
49144919 (kwargs == NULL || PyDict_Size (kwargs ) == 0 ) &&
49154920 co -> co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ))
0 commit comments