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

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 3 years, 4 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
« no previous file with comments | « Objects/descrobject.c ('k') | Objects/methodobject.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 func_memberlist, /* tp_members */ 616 func_memberlist, /* tp_members */
617 func_getsetlist, /* tp_getset */ 617 func_getsetlist, /* tp_getset */
618 0, /* tp_base */ 618 0, /* tp_base */
619 0, /* tp_dict */ 619 0, /* tp_dict */
620 func_descr_get, /* tp_descr_get */ 620 func_descr_get, /* tp_descr_get */
621 0, /* tp_descr_set */ 621 0, /* tp_descr_set */
622 offsetof(PyFunctionObject, func_dict), /* tp_dictoffset */ 622 offsetof(PyFunctionObject, func_dict), /* tp_dictoffset */
623 0, /* tp_init */ 623 0, /* tp_init */
624 0, /* tp_alloc */ 624 0, /* tp_alloc */
625 func_new, /* tp_new */ 625 func_new, /* tp_new */
626
627 .tp_fastcall = _PyFunction_FastCallKeywords,
626 }; 628 };
627 629
628 630
629 /* Class method object */ 631 /* Class method object */
630 632
631 /* A class method receives the class as implicit first argument, 633 /* A class method receives the class as implicit first argument,
632 just like an instance method receives the instance. 634 just like an instance method receives the instance.
633 To declare a class method, use this idiom: 635 To declare a class method, use this idiom:
634 636
635 class C: 637 class C:
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 PyStaticMethod_New(PyObject *callable) 983 PyStaticMethod_New(PyObject *callable)
982 { 984 {
983 staticmethod *sm = (staticmethod *) 985 staticmethod *sm = (staticmethod *)
984 PyType_GenericAlloc(&PyStaticMethod_Type, 0); 986 PyType_GenericAlloc(&PyStaticMethod_Type, 0);
985 if (sm != NULL) { 987 if (sm != NULL) {
986 Py_INCREF(callable); 988 Py_INCREF(callable);
987 sm->sm_callable = callable; 989 sm->sm_callable = callable;
988 } 990 }
989 return (PyObject *)sm; 991 return (PyObject *)sm;
990 } 992 }
OLDNEW
« no previous file with comments | « Objects/descrobject.c ('k') | Objects/methodobject.c » ('j') | no next file with comments »

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