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

Side by Side Diff: Objects/funcobject.c

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Patch Set: Created 2 years, 12 months ago
Left:
Right:
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 unified diff | Download patch
OLDNEW
1 1
2 /* Function object implementation */ 2 /* Function object implementation */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 #include "code.h" 5 #include "code.h"
6 #include "structmember.h" 6 #include "structmember.h"
7 7
8 PyObject * 8 PyObject *
9 PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname ) 9 PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname )
10 { 10 {
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 func_memberlist, /* tp_members */ 614 func_memberlist, /* tp_members */
615 func_getsetlist, /* tp_getset */ 615 func_getsetlist, /* tp_getset */
616 0, /* tp_base */ 616 0, /* tp_base */
617 0, /* tp_dict */ 617 0, /* tp_dict */
618 func_descr_get, /* tp_descr_get */ 618 func_descr_get, /* tp_descr_get */
619 0, /* tp_descr_set */ 619 0, /* tp_descr_set */
620 offsetof(PyFunctionObject, func_dict), /* tp_dictoffset */ 620 offsetof(PyFunctionObject, func_dict), /* tp_dictoffset */
621 0, /* tp_init */ 621 0, /* tp_init */
622 0, /* tp_alloc */ 622 0, /* tp_alloc */
623 func_new, /* tp_new */ 623 func_new, /* tp_new */
624
625 .tp_fastcall = _PyFunction_FastCallKeywords,
624 }; 626 };
625 627
626 628
627 /* Class method object */ 629 /* Class method object */
628 630
629 /* A class method receives the class as implicit first argument, 631 /* A class method receives the class as implicit first argument,
630 just like an instance method receives the instance. 632 just like an instance method receives the instance.
631 To declare a class method, use this idiom: 633 To declare a class method, use this idiom:
632 634
633 class C: 635 class C:
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 PyStaticMethod_New(PyObject *callable) 981 PyStaticMethod_New(PyObject *callable)
980 { 982 {
981 staticmethod *sm = (staticmethod *) 983 staticmethod *sm = (staticmethod *)
982 PyType_GenericAlloc(&PyStaticMethod_Type, 0); 984 PyType_GenericAlloc(&PyStaticMethod_Type, 0);
983 if (sm != NULL) { 985 if (sm != NULL) {
984 Py_INCREF(callable); 986 Py_INCREF(callable);
985 sm->sm_callable = callable; 987 sm->sm_callable = callable;
986 } 988 }
987 return (PyObject *)sm; 989 return (PyObject *)sm;
988 } 990 }
OLDNEW

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