@@ -24,14 +24,16 @@ typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
24
24
typedef PyObject * (* wrapperfunc_kwds )(PyObject * self , PyObject * args ,
25
25
void * wrapped , PyObject * kwds );
26
26
27
+ // Pyston addition: faster CC
27
28
typedef PyObject * (* wrapperfunc_1arg )(PyObject * self , void * wrapped );
29
+ typedef PyObject * (* wrapperfunc_2arg )(PyObject * self , PyObject * arg , void * wrapped );
28
30
29
31
struct wrapperbase {
30
- char * name ;
32
+ const char * name ;
31
33
int offset ;
32
34
void * function ;
33
35
wrapperfunc wrapper ;
34
- char * doc ;
36
+ const char * doc ;
35
37
int flags ;
36
38
PyObject * name_strobj ;
37
39
};
@@ -45,8 +47,6 @@ struct wrapperbase {
45
47
46
48
/* Various kinds of descriptor objects */
47
49
48
- // Pyston change: these are not our object layouts
49
- #if 0
50
50
#define PyDescr_COMMON \
51
51
PyObject_HEAD \
52
52
PyTypeObject *d_type; \
@@ -76,21 +76,11 @@ typedef struct {
76
76
struct wrapperbase * d_base ;
77
77
void * d_wrapped ; /* This can be any function pointer */
78
78
} PyWrapperDescrObject ;
79
- #endif
80
- // (Pyston TODO: add opaque definitions of those names)
81
79
82
- // Pyston change: these are not static objects any more
83
- #if 0
84
80
PyAPI_DATA (PyTypeObject ) PyWrapperDescr_Type ;
85
81
PyAPI_DATA (PyTypeObject ) PyDictProxy_Type ;
86
82
PyAPI_DATA (PyTypeObject ) PyGetSetDescr_Type ;
87
83
PyAPI_DATA (PyTypeObject ) PyMemberDescr_Type ;
88
- #else
89
- PyAPI_DATA (PyTypeObject ) PyDictProxy_Type ;
90
- #endif
91
- // (Pyston TODO: add #defines to our names)
92
- PyAPI_DATA (PyTypeObject * ) wrapperdescr_cls ;
93
- #define PyWrapperDescr_Type (*wrapperdescr_cls)
94
84
95
85
PyAPI_FUNC (PyObject * ) PyDescr_NewMethod (PyTypeObject * , PyMethodDef * ) PYSTON_NOEXCEPT ;
96
86
PyAPI_FUNC (PyObject * ) PyDescr_NewClassMethod (PyTypeObject * , PyMethodDef * ) PYSTON_NOEXCEPT ;
@@ -106,8 +96,17 @@ PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *) PYSTON_NOEXCEPT;
106
96
PyAPI_FUNC (PyObject * ) PyWrapper_New (PyObject * , PyObject * ) PYSTON_NOEXCEPT ;
107
97
108
98
109
- // Pyston change: this is no longer a static object
110
- //PyAPI_DATA(PyTypeObject) PyProperty_Type;
99
+ PyAPI_DATA (PyTypeObject ) PyProperty_Type ;
100
+
101
+ // Pyston change: exposed these
102
+ typedef struct {
103
+ PyObject_HEAD
104
+ PyWrapperDescrObject * descr ;
105
+ PyObject * self ;
106
+ } wrapperobject ;
107
+ PyAPI_DATA (PyTypeObject ) wrappertype ;
108
+ PyAPI_DATA (PyTypeObject ) PyMethodDescr_Type ;
109
+ PyAPI_DATA (PyTypeObject ) PyClassMethodDescr_Type ;
111
110
112
111
#ifdef __cplusplus
113
112
}
0 commit comments