From 7372e18fa83aa35766f8f6fdf3aed27fac2d52d2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 17 Jan 2017 01:35:17 +0100 Subject: Run Argument Clinic: METH_VARARGS=>METH_FASTCALL Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using only positional arguments. --- Modules/clinic/_opcode.c.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Modules/clinic/_opcode.c.h') diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h index 513cbfdad8..77f31d9b5f 100644 --- a/Modules/clinic/_opcode.c.h +++ b/Modules/clinic/_opcode.c.h @@ -9,23 +9,27 @@ PyDoc_STRVAR(_opcode_stack_effect__doc__, "Compute the stack effect of the opcode."); #define _OPCODE_STACK_EFFECT_METHODDEF \ - {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__}, + {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_FASTCALL, _opcode_stack_effect__doc__}, static int _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg); static PyObject * -_opcode_stack_effect(PyObject *module, PyObject *args) +_opcode_stack_effect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; int opcode; PyObject *oparg = Py_None; int _return_value; - if (!PyArg_ParseTuple(args, "i|O:stack_effect", + if (!_PyArg_ParseStack(args, nargs, "i|O:stack_effect", &opcode, &oparg)) { goto exit; } + + if (!_PyArg_NoStackKeywords("stack_effect", kwnames)) { + goto exit; + } _return_value = _opcode_stack_effect_impl(module, opcode, oparg); if ((_return_value == -1) && PyErr_Occurred()) { goto exit; @@ -35,4 +39,4 @@ _opcode_stack_effect(PyObject *module, PyObject *args) exit: return return_value; } -/*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=62858005ac85baa9 input=a9049054013a1b77]*/ -- cgit v1.2.1