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

Delta Between Two Patch Sets: Include/descrobject.h

Issue 29259: Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects
Left Patch Set: Created 3 years, 2 months ago
Right Patch Set: Created 3 years, 2 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:
Right: Side by side diff | Download
LEFTRIGHT
(no file at all)
1 /* Descriptors */ 1 /* Descriptors */
2 #ifndef Py_DESCROBJECT_H 2 #ifndef Py_DESCROBJECT_H
3 #define Py_DESCROBJECT_H 3 #define Py_DESCROBJECT_H
4 #ifdef __cplusplus 4 #ifdef __cplusplus
5 extern "C" { 5 extern "C" {
6 #endif 6 #endif
7 7
8 typedef PyObject *(*getter)(PyObject *, void *); 8 typedef PyObject *(*getter)(PyObject *, void *);
9 typedef int (*setter)(PyObject *, PyObject *, void *); 9 typedef int (*setter)(PyObject *, PyObject *, void *);
10 10
11 typedef struct PyGetSetDef { 11 typedef struct PyGetSetDef {
12 const char *name; 12 const char *name;
13 getter get; 13 getter get;
14 setter set; 14 setter set;
15 const char *doc; 15 const char *doc;
16 void *closure; 16 void *closure;
17 } PyGetSetDef; 17 } PyGetSetDef;
18 18
19 #ifndef Py_LIMITED_API 19 #ifndef Py_LIMITED_API
20 typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, 20 typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
21 void *wrapped); 21 void *wrapped);
22 22
23 typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, 23 typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
24 void *wrapped, PyObject *kwds); 24 void *wrapped, PyObject *kwds);
25 25
26 typedef PyObject *(*wrapperfunc_fast)(PyObject *self, void *wrapped,
27 PyObject **args, Py_ssize_t nargs,
28 PyObject *kwnames);
29
26 struct wrapperbase { 30 struct wrapperbase {
27 const char *name; 31 const char *name;
28 int offset; 32 int offset;
29 void *function; 33 void *function;
30 wrapperfunc wrapper; 34 wrapperfunc wrapper;
35 wrapperfunc_fast fastwrapper;
31 const char *doc; 36 const char *doc;
32 int flags; 37 int flags;
33 PyObject *name_strobj; 38 PyObject *name_strobj;
34 }; 39 };
35 40
36 /* Flags for above struct */ 41 /* Flags for above struct */
37 #define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ 42 #define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */
38 43
39 /* Various kinds of descriptor objects */ 44 /* Various kinds of descriptor objects */
40 45
(...skipping 21 matching lines...) Expand all
62 67
63 typedef struct { 68 typedef struct {
64 PyDescr_COMMON; 69 PyDescr_COMMON;
65 PyGetSetDef *d_getset; 70 PyGetSetDef *d_getset;
66 } PyGetSetDescrObject; 71 } PyGetSetDescrObject;
67 72
68 typedef struct { 73 typedef struct {
69 PyDescr_COMMON; 74 PyDescr_COMMON;
70 struct wrapperbase *d_base; 75 struct wrapperbase *d_base;
71 void *d_wrapped; /* This can be any function pointer */ 76 void *d_wrapped; /* This can be any function pointer */
77 int d_use_fastwrapper;
72 } PyWrapperDescrObject; 78 } PyWrapperDescrObject;
73 #endif /* Py_LIMITED_API */ 79 #endif /* Py_LIMITED_API */
74 80
75 PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type; 81 PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
76 PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type; 82 PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
77 PyAPI_DATA(PyTypeObject) PyMemberDescr_Type; 83 PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
78 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type; 84 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
79 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type; 85 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
80 PyAPI_DATA(PyTypeObject) PyDictProxy_Type; 86 PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
81 #ifndef Py_LIMITED_API 87 #ifndef Py_LIMITED_API
82 PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type; 88 PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
83 #endif /* Py_LIMITED_API */ 89 #endif /* Py_LIMITED_API */
84 90
85 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *); 91 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
86 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *); 92 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
87 struct PyMemberDef; /* forward declaration for following prototype */ 93 struct PyMemberDef; /* forward declaration for following prototype */
88 PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, 94 PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,
89 struct PyMemberDef *); 95 struct PyMemberDef *);
90 PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, 96 PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
91 struct PyGetSetDef *); 97 struct PyGetSetDef *);
92 #ifndef Py_LIMITED_API 98 #ifndef Py_LIMITED_API
93 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, 99 PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
94 struct wrapperbase *, void *); 100 struct wrapperbase *, void *);
95 #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL) 101 #define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
102
103 PyAPI_FUNC(PyObject *) _PyDescr_NewWrapperEx(PyTypeObject *type,
104 struct wrapperbase *base,
105 void *wrapped,
106 int use_fastwrapper);
96 #endif 107 #endif
97 108
98 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *); 109 PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
99 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *); 110 PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
100 111
101 112
102 PyAPI_DATA(PyTypeObject) PyProperty_Type; 113 PyAPI_DATA(PyTypeObject) PyProperty_Type;
103 #ifdef __cplusplus 114 #ifdef __cplusplus
104 } 115 }
105 #endif 116 #endif
106 #endif /* !Py_DESCROBJECT_H */ 117 #endif /* !Py_DESCROBJECT_H */
107 118
LEFTRIGHT

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