@@ -9,7 +9,7 @@ extern "C" {
9
9
struct _frame {
10
10
PyObject_HEAD
11
11
PyFrameObject * f_back ; /* previous frame, or NULL */
12
- struct _interpreter_frame * f_frame ; /* points to the frame data */
12
+ struct _PyInterpreterFrame * f_frame ; /* points to the frame data */
13
13
PyObject * f_trace ; /* Trace function */
14
14
int f_lineno ; /* Current line number. Only valid if non-zero */
15
15
char f_trace_lines ; /* Emit per-line trace events? */
@@ -48,63 +48,63 @@ typedef signed char PyFrameState;
48
48
unless it's -1 in which case next_instr should be first_instr.
49
49
*/
50
50
51
- typedef struct _interpreter_frame {
51
+ typedef struct _PyInterpreterFrame {
52
52
PyFunctionObject * f_func ; /* Strong reference */
53
53
PyObject * f_globals ; /* Borrowed reference */
54
54
PyObject * f_builtins ; /* Borrowed reference */
55
55
PyObject * f_locals ; /* Strong reference, may be NULL */
56
56
PyCodeObject * f_code ; /* Strong reference */
57
57
PyFrameObject * frame_obj ; /* Strong reference, may be NULL */
58
- struct _interpreter_frame * previous ;
58
+ struct _PyInterpreterFrame * previous ;
59
59
int f_lasti ; /* Last instruction if called */
60
60
int stacktop ; /* Offset of TOS from localsplus */
61
61
PyFrameState f_state ; /* What state the frame is in */
62
62
bool is_entry ; // Whether this is the "root" frame for the current CFrame.
63
63
bool is_generator ;
64
64
PyObject * localsplus [1 ];
65
- } InterpreterFrame ;
65
+ } _PyInterpreterFrame ;
66
66
67
- static inline int _PyFrame_IsRunnable (InterpreterFrame * f ) {
67
+ static inline int _PyFrame_IsRunnable (_PyInterpreterFrame * f ) {
68
68
return f -> f_state < FRAME_EXECUTING ;
69
69
}
70
70
71
- static inline int _PyFrame_IsExecuting (InterpreterFrame * f ) {
71
+ static inline int _PyFrame_IsExecuting (_PyInterpreterFrame * f ) {
72
72
return f -> f_state == FRAME_EXECUTING ;
73
73
}
74
74
75
- static inline int _PyFrameHasCompleted (InterpreterFrame * f ) {
75
+ static inline int _PyFrameHasCompleted (_PyInterpreterFrame * f ) {
76
76
return f -> f_state > FRAME_EXECUTING ;
77
77
}
78
78
79
- static inline PyObject * * _PyFrame_Stackbase (InterpreterFrame * f ) {
79
+ static inline PyObject * * _PyFrame_Stackbase (_PyInterpreterFrame * f ) {
80
80
return f -> localsplus + f -> f_code -> co_nlocalsplus ;
81
81
}
82
82
83
- static inline PyObject * _PyFrame_StackPeek (InterpreterFrame * f ) {
83
+ static inline PyObject * _PyFrame_StackPeek (_PyInterpreterFrame * f ) {
84
84
assert (f -> stacktop > f -> f_code -> co_nlocalsplus );
85
85
assert (f -> localsplus [f -> stacktop - 1 ] != NULL );
86
86
return f -> localsplus [f -> stacktop - 1 ];
87
87
}
88
88
89
- static inline PyObject * _PyFrame_StackPop (InterpreterFrame * f ) {
89
+ static inline PyObject * _PyFrame_StackPop (_PyInterpreterFrame * f ) {
90
90
assert (f -> stacktop > f -> f_code -> co_nlocalsplus );
91
91
f -> stacktop -- ;
92
92
return f -> localsplus [f -> stacktop ];
93
93
}
94
94
95
- static inline void _PyFrame_StackPush (InterpreterFrame * f , PyObject * value ) {
95
+ static inline void _PyFrame_StackPush (_PyInterpreterFrame * f , PyObject * value ) {
96
96
f -> localsplus [f -> stacktop ] = value ;
97
97
f -> stacktop ++ ;
98
98
}
99
99
100
- #define FRAME_SPECIALS_SIZE ((sizeof(InterpreterFrame )-1)/sizeof(PyObject *))
100
+ #define FRAME_SPECIALS_SIZE ((sizeof(_PyInterpreterFrame )-1)/sizeof(PyObject *))
101
101
102
- void _PyFrame_Copy (InterpreterFrame * src , InterpreterFrame * dest );
102
+ void _PyFrame_Copy (_PyInterpreterFrame * src , _PyInterpreterFrame * dest );
103
103
104
104
/* Consumes reference to func */
105
105
static inline void
106
106
_PyFrame_InitializeSpecials (
107
- InterpreterFrame * frame , PyFunctionObject * func ,
107
+ _PyInterpreterFrame * frame , PyFunctionObject * func ,
108
108
PyObject * locals , int nlocalsplus )
109
109
{
110
110
frame -> f_func = func ;
@@ -124,33 +124,33 @@ _PyFrame_InitializeSpecials(
124
124
* that precedes this frame.
125
125
*/
126
126
static inline PyObject * *
127
- _PyFrame_GetLocalsArray (InterpreterFrame * frame )
127
+ _PyFrame_GetLocalsArray (_PyInterpreterFrame * frame )
128
128
{
129
129
return frame -> localsplus ;
130
130
}
131
131
132
132
static inline PyObject * *
133
- _PyFrame_GetStackPointer (InterpreterFrame * frame )
133
+ _PyFrame_GetStackPointer (_PyInterpreterFrame * frame )
134
134
{
135
135
return frame -> localsplus + frame -> stacktop ;
136
136
}
137
137
138
138
static inline void
139
- _PyFrame_SetStackPointer (InterpreterFrame * frame , PyObject * * stack_pointer )
139
+ _PyFrame_SetStackPointer (_PyInterpreterFrame * frame , PyObject * * stack_pointer )
140
140
{
141
141
frame -> stacktop = (int )(stack_pointer - frame -> localsplus );
142
142
}
143
143
144
144
/* For use by _PyFrame_GetFrameObject
145
145
Do not call directly. */
146
146
PyFrameObject *
147
- _PyFrame_MakeAndSetFrameObject (InterpreterFrame * frame );
147
+ _PyFrame_MakeAndSetFrameObject (_PyInterpreterFrame * frame );
148
148
149
149
/* Gets the PyFrameObject for this frame, lazily
150
150
* creating it if necessary.
151
151
* Returns a borrowed referennce */
152
152
static inline PyFrameObject *
153
- _PyFrame_GetFrameObject (InterpreterFrame * frame )
153
+ _PyFrame_GetFrameObject (_PyInterpreterFrame * frame )
154
154
{
155
155
PyFrameObject * res = frame -> frame_obj ;
156
156
if (res != NULL ) {
@@ -160,7 +160,7 @@ _PyFrame_GetFrameObject(InterpreterFrame *frame)
160
160
}
161
161
162
162
/* Clears all references in the frame.
163
- * If take is non-zero, then the InterpreterFrame frame
163
+ * If take is non-zero, then the _PyInterpreterFrame frame
164
164
* may be transferred to the frame object it references
165
165
* instead of being cleared. Either way
166
166
* the caller no longer owns the references
@@ -169,21 +169,21 @@ _PyFrame_GetFrameObject(InterpreterFrame *frame)
169
169
* frames like the ones in generators and coroutines.
170
170
*/
171
171
void
172
- _PyFrame_Clear (InterpreterFrame * frame );
172
+ _PyFrame_Clear (_PyInterpreterFrame * frame );
173
173
174
174
int
175
- _PyFrame_Traverse (InterpreterFrame * frame , visitproc visit , void * arg );
175
+ _PyFrame_Traverse (_PyInterpreterFrame * frame , visitproc visit , void * arg );
176
176
177
177
int
178
- _PyFrame_FastToLocalsWithError (InterpreterFrame * frame );
178
+ _PyFrame_FastToLocalsWithError (_PyInterpreterFrame * frame );
179
179
180
180
void
181
- _PyFrame_LocalsToFast (InterpreterFrame * frame , int clear );
181
+ _PyFrame_LocalsToFast (_PyInterpreterFrame * frame , int clear );
182
182
183
- extern InterpreterFrame *
183
+ extern _PyInterpreterFrame *
184
184
_PyThreadState_BumpFramePointerSlow (PyThreadState * tstate , size_t size );
185
185
186
- static inline InterpreterFrame *
186
+ static inline _PyInterpreterFrame *
187
187
_PyThreadState_BumpFramePointer (PyThreadState * tstate , size_t size )
188
188
{
189
189
PyObject * * base = tstate -> datastack_top ;
@@ -192,16 +192,16 @@ _PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size)
192
192
assert (tstate -> datastack_limit );
193
193
if (top < tstate -> datastack_limit ) {
194
194
tstate -> datastack_top = top ;
195
- return (InterpreterFrame * )base ;
195
+ return (_PyInterpreterFrame * )base ;
196
196
}
197
197
}
198
198
return _PyThreadState_BumpFramePointerSlow (tstate , size );
199
199
}
200
200
201
- void _PyThreadState_PopFrame (PyThreadState * tstate , InterpreterFrame * frame );
201
+ void _PyThreadState_PopFrame (PyThreadState * tstate , _PyInterpreterFrame * frame );
202
202
203
203
/* Consume reference to func */
204
- InterpreterFrame *
204
+ _PyInterpreterFrame *
205
205
_PyFrame_Push (PyThreadState * tstate , PyFunctionObject * func );
206
206
207
207
#ifdef __cplusplus
0 commit comments