cpython: ffcfa4f005a3 (original) (raw)

Mercurial > cpython

changeset 102911:ffcfa4f005a3

Issue #27830: Revert, remove _PyFunction_FastCallKeywords() [#27830]

Victor Stinner victor.stinner@gmail.com
date Thu, 25 Aug 2016 23:26:50 +0200
parents a0a7c5b1af97
children 10a73648c92c
files Include/abstract.h Include/funcobject.h Objects/abstract.c Python/ceval.c
diffstat 4 files changed, 6 insertions(+), 74 deletions(-)[+] [-] Include/abstract.h 17 Include/funcobject.h 6 Objects/abstract.c 45 Python/ceval.c 12

line wrap: on

line diff

--- a/Include/abstract.h +++ b/Include/abstract.h @@ -292,23 +292,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #define _PyObject_CallArg1(func, arg) [](#l1.4) _PyObject_FastCall((func), &(arg), 1)

-

-

-

- PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func, PyObject *obj, PyObject *args, PyObject *kwargs);

--- a/Include/funcobject.h +++ b/Include/funcobject.h @@ -64,12 +64,6 @@ PyAPI_FUNC(PyObject *) _PyFunction_FastC PyObject **args, Py_ssize_t nargs, PyObject *kwargs); - -PyAPI_FUNC(PyObject *) _PyFunction_FastCallKeywords(

#endif /* Macros for direct access to these values. Type checks are not

--- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2343,51 +2343,6 @@ static PyObject * return kwdict; } -PyObject * -_PyObject_FastCallKeywords(PyObject *func, PyObject **stack, Py_ssize_t nargs,

-{

-

-

-

-

-

-

-

-} - /* Positional arguments are obj followed args. */ PyObject * _PyObject_Call_Prepend(PyObject *func,

--- a/Python/ceval.c +++ b/Python/ceval.c @@ -113,6 +113,7 @@ static PyObject * call_function(PyObject #else static PyObject * call_function(PyObject ***, int); #endif +static PyObject * fast_function(PyObject *, PyObject **, Py_ssize_t, Py_ssize_t); static PyObject * do_call(PyObject *, PyObject ***, Py_ssize_t, Py_ssize_t); static PyObject * ext_do_call(PyObject *, PyObject ***, int, Py_ssize_t, Py_ssize_t); static PyObject * update_keyword_args(PyObject *, Py_ssize_t, PyObject ***, @@ -4766,7 +4767,7 @@ call_function(PyObject ***pp_stack, int } READ_TIMESTAMP(*pintr0); if (PyFunction_Check(func)) {

@@ -4779,7 +4780,7 @@ call_function(PyObject **pp_stack, int / Clear the stack of the function object. Also removes the arguments in case they weren't consumed already

@@ -4791,7 +4792,7 @@ call_function(PyObject pp_stack, int return x; } -/ The _PyFunction_FastCallKeywords() function optimize calls for which no argument +/ The fast_function() function optimize calls for which no argument tuple is necessary; the objects are passed directly from the stack. For the simplest case -- a function that takes only positional arguments and is called with only positional arguments -- it @@ -4839,9 +4840,8 @@ static PyObject /* Similar to _PyFunction_FastCall() but keywords are passed a (key, value) pairs in stack */ -PyObject * -_PyFunction_FastCallKeywords(PyObject *func, PyObject **stack,

+static PyObject * +fast_function(PyObject *func, PyObject **stack, Py_ssize_t nargs, Py_ssize_t nkwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func);