Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9)

Unified Diff: Objects/classobject.c

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Patch Set: Created 2 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
--- a/Objects/classobject.c Wed Jan 25 23:33:27 2017 +0100
+++ b/Objects/classobject.c Thu Jan 26 02:43:18 2017 +0100
@@ -302,7 +302,8 @@ method_traverse(PyMethodObject *im, visi
}
static PyObject *
-method_call(PyObject *method, PyObject *args, PyObject *kwargs)
+method_call(PyObject *method, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
PyObject *self, *func;
@@ -313,8 +314,7 @@ method_call(PyObject *method, PyObject *
}
func = PyMethod_GET_FUNCTION(method);
-
- return _PyObject_Call_Prepend(func, self, args, kwargs);
+ return _PyObject_FastCall_Prepend(func, self, args, nargs, kwnames);
}
static PyObject *
@@ -346,7 +346,7 @@ PyTypeObject PyMethod_Type = {
0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)method_hash, /* tp_hash */
- method_call, /* tp_call */
+ 0, /* tp_call */
0, /* tp_str */
method_getattro, /* tp_getattro */
PyObject_GenericSetAttr, /* tp_setattro */
@@ -370,6 +370,8 @@ PyTypeObject PyMethod_Type = {
0, /* tp_init */
0, /* tp_alloc */
method_new, /* tp_new */
+
+ .tp_fastcall = (fastternaryfunc)method_call,
};
/* Clear out the free list */

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+