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.
This commit is contained in:
Victor Stinner 2017-01-17 01:35:17 +01:00
parent 0c8c3893ae
commit 259f0e4437
52 changed files with 1515 additions and 679 deletions

View file

@ -35,4 +35,4 @@ warnings_warn(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
exit:
return return_value;
}
/*[clinic end generated code: output=b3c5297c2c55778c input=a9049054013a1b77]*/
/*[clinic end generated code: output=acadf1788059034c input=a9049054013a1b77]*/

View file

@ -80,22 +80,26 @@ PyDoc_STRVAR(builtin_format__doc__,
"format_spec defaults to the empty string");
#define BUILTIN_FORMAT_METHODDEF \
{"format", (PyCFunction)builtin_format, METH_VARARGS, builtin_format__doc__},
{"format", (PyCFunction)builtin_format, METH_FASTCALL, builtin_format__doc__},
static PyObject *
builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec);
static PyObject *
builtin_format(PyObject *module, PyObject *args)
builtin_format(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *value;
PyObject *format_spec = NULL;
if (!PyArg_ParseTuple(args, "O|U:format",
if (!_PyArg_ParseStack(args, nargs, "O|U:format",
&value, &format_spec)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("format", kwnames)) {
goto exit;
}
return_value = builtin_format_impl(module, value, format_spec);
exit:
@ -674,4 +678,4 @@ builtin_issubclass(PyObject *module, PyObject *args)
exit:
return return_value;
}
/*[clinic end generated code: output=63483deb75805f7c input=a9049054013a1b77]*/
/*[clinic end generated code: output=66818a69d6d23181 input=a9049054013a1b77]*/

View file

@ -75,23 +75,27 @@ PyDoc_STRVAR(_imp__fix_co_filename__doc__,
" File path to use.");
#define _IMP__FIX_CO_FILENAME_METHODDEF \
{"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, _imp__fix_co_filename__doc__},
{"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__},
static PyObject *
_imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code,
PyObject *path);
static PyObject *
_imp__fix_co_filename(PyObject *module, PyObject *args)
_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyCodeObject *code;
PyObject *path;
if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename",
if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename",
&PyCode_Type, &code, &path)) {
goto exit;
}
if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) {
goto exit;
}
return_value = _imp__fix_co_filename_impl(module, code, path);
exit:
@ -361,4 +365,4 @@ exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/
/*[clinic end generated code: output=5a3f012344950548 input=a9049054013a1b77]*/