diff options
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/code.h | 2 | ||||
-rw-r--r-- | Include/cpython/frameobject.h | 10 | ||||
-rw-r--r-- | Include/cpython/pystate.h | 9 |
3 files changed, 14 insertions, 7 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 330f1f54d1..575a4b72b2 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -40,8 +40,8 @@ struct PyCodeObject { PyObject *co_name; /* unicode (name, for reference) */ PyObject *co_linetable; /* string (encoding addr<->lineno mapping) See Objects/lnotab_notes.txt for details. */ + int co_nlocalsplus; /* Number of locals + free + cell variables */ PyObject *co_exceptiontable; /* Byte string encoding exception handling table */ - void *co_zombieframe; /* for optimization only (see frameobject.c) */ PyObject *co_weakreflist; /* to support weakrefs to code objects */ /* Scratch space for extra data relating to the code object. Type is a void* to keep the format private in codeobject.c to force diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h index 581664775c..fc20bc2ff8 100644 --- a/Include/cpython/frameobject.h +++ b/Include/cpython/frameobject.h @@ -20,12 +20,9 @@ enum _framestate { typedef signed char PyFrameState; struct _frame { - PyObject_VAR_HEAD + PyObject_HEAD struct _frame *f_back; /* previous frame, or NULL */ PyCodeObject *f_code; /* code segment */ - PyObject *f_builtins; /* builtin symbol table (PyDictObject) */ - PyObject *f_globals; /* global symbol table (PyDictObject) */ - PyObject *f_locals; /* local symbol table (any mapping) */ PyObject **f_valuestack; /* points after the last local */ PyObject *f_trace; /* Trace function */ /* Borrowed reference to a generator, or NULL */ @@ -36,7 +33,8 @@ struct _frame { PyFrameState f_state; /* What state the frame is in */ char f_trace_lines; /* Emit per-line trace events? */ char f_trace_opcodes; /* Emit per-opcode trace events? */ - PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ + char f_own_locals_memory; /* This frame owns the memory for the locals */ + PyObject **f_localsptr; /* Pointer to locals, cells, free */ }; static inline int _PyFrame_IsRunnable(struct _frame *f) { @@ -62,7 +60,7 @@ PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *, /* only internal use */ PyFrameObject* -_PyFrame_New_NoTrack(PyThreadState *, PyFrameConstructor *, PyObject *); +_PyFrame_New_NoTrack(PyThreadState *, PyFrameConstructor *, PyObject *, PyObject **); /* The rest of the interface is specific for frame objects */ diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index e3ccc54356..63ba60074d 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -57,6 +57,12 @@ typedef struct _err_stackitem { } _PyErr_StackItem; +typedef struct _stack_chunk { + struct _stack_chunk *previous; + size_t size; + size_t top; + PyObject * data[1]; /* Variable sized */ +} _PyStackChunk; // The PyThreadState typedef is in Include/pystate.h. struct _ts { @@ -149,6 +155,9 @@ struct _ts { CFrame root_cframe; + _PyStackChunk *datastack_chunk; + PyObject **datastack_top; + PyObject **datastack_limit; /* XXX signal handlers should also be here */ }; |