summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_ceval.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-07-26 10:22:16 (GMT)
committerGitHub <noreply@github.com>2021-07-26 10:22:16 (GMT)
commitae0a2b756255629140efcbe57fc2e714f0267aa3 (patch)
tree8710e8c7a398c9ec0add227fab607f367242a7e5 /Include/internal/pycore_ceval.h
parent0363a4014d90df17a29042de008ef0b659f92505 (diff)
downloadcpython-ae0a2b756255629140efcbe57fc2e714f0267aa3.zip
cpython-ae0a2b756255629140efcbe57fc2e714f0267aa3.tar.gz
cpython-ae0a2b756255629140efcbe57fc2e714f0267aa3.tar.bz2
bpo-44590: Lazily allocate frame objects (GH-27077)
* Convert "specials" array to InterpreterFrame struct, adding f_lasti, f_state and other non-debug FrameObject fields to it. * Refactor, calls pushing the call to the interpreter upward toward _PyEval_Vector. * Compute f_back when on thread stack, only filling in value when frame object outlives stack invocation. * Move ownership of InterpreterFrame in generator from frame object to generator object. * Do not create frame objects for Python calls. * Do not create frame objects for generators.
Diffstat (limited to 'Include/internal/pycore_ceval.h')
-rw-r--r--Include/internal/pycore_ceval.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index f573c3e..66ddc99 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -41,9 +41,9 @@ extern PyObject *_PyEval_BuiltinsFromGlobals(
static inline PyObject*
-_PyEval_EvalFrame(PyThreadState *tstate, PyFrameObject *f, int throwflag)
+_PyEval_EvalFrame(PyThreadState *tstate, struct _interpreter_frame *frame, int throwflag)
{
- return tstate->interp->eval_frame(tstate, f, throwflag);
+ return tstate->interp->eval_frame(tstate, frame, throwflag);
}
extern PyObject *
@@ -107,6 +107,9 @@ static inline void _Py_LeaveRecursiveCall_inline(void) {
#define Py_LeaveRecursiveCall() _Py_LeaveRecursiveCall_inline()
+struct _interpreter_frame *_PyEval_GetFrame(void);
+
+PyObject *_Py_MakeCoro(PyFrameConstructor *, struct _interpreter_frame *);
#ifdef __cplusplus
}