summaryrefslogtreecommitdiff
path: root/Include/internal/pycore_frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_frame.h')
-rw-r--r--Include/internal/pycore_frame.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index feee692d0f..7fa410d288 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -42,17 +42,18 @@ typedef enum _framestate {
enum _frameowner {
FRAME_OWNED_BY_THREAD = 0,
FRAME_OWNED_BY_GENERATOR = 1,
- FRAME_OWNED_BY_FRAME_OBJECT = 2
+ FRAME_OWNED_BY_FRAME_OBJECT = 2,
+ FRAME_OWNED_BY_CSTACK = 3,
};
typedef struct _PyInterpreterFrame {
/* "Specials" section */
- PyObject *f_funcobj; /* Strong reference */
- PyObject *f_globals; /* Borrowed reference */
- PyObject *f_builtins; /* Borrowed reference */
- PyObject *f_locals; /* Strong reference, may be NULL */
+ PyObject *f_funcobj; /* Strong reference. Only valid if not on C stack */
+ PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
+ PyObject *f_builtins; /* Borrowed reference. Only valid if not on C stack */
+ PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
PyCodeObject *f_code; /* Strong reference */
- PyFrameObject *frame_obj; /* Strong reference, may be NULL */
+ PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
/* Linkage section */
struct _PyInterpreterFrame *previous;
// NOTE: This is not necessarily the last instruction started in the given
@@ -60,9 +61,8 @@ typedef struct _PyInterpreterFrame {
// example, it may be an inline CACHE entry, an instruction we just jumped
// over, or (in the case of a newly-created frame) a totally invalid value:
_Py_CODEUNIT *prev_instr;
- int stacktop; /* Offset of TOS from localsplus */
+ int stacktop; /* Offset of TOS from localsplus */
uint16_t yield_offset;
- bool is_entry; // Whether this is the "root" frame for the current _PyCFrame.
char owner;
/* Locals and stack */
PyObject *localsplus[1];
@@ -110,7 +110,6 @@ _PyFrame_InitializeSpecials(
frame->stacktop = code->co_nlocalsplus;
frame->frame_obj = NULL;
frame->prev_instr = _PyCode_CODE(code) - 1;
- frame->is_entry = false;
frame->yield_offset = 0;
frame->owner = FRAME_OWNED_BY_THREAD;
}