diff options
| author | Mark Shannon <mark@hotpy.org> | 2021-07-26 11:22:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-26 11:22:16 +0100 |
| commit | ae0a2b756255629140efcbe57fc2e714f0267aa3 (patch) | |
| tree | 8710e8c7a398c9ec0add227fab607f367242a7e5 /Python/_warnings.c | |
| parent | 0363a4014d90df17a29042de008ef0b659f92505 (diff) | |
| download | cpython-git-ae0a2b756255629140efcbe57fc2e714f0267aa3.tar.gz | |
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 'Python/_warnings.c')
| -rw-r--r-- | Python/_warnings.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index 9f68da2087..cf2110d31c 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -854,10 +854,8 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, *lineno = 1; } else { - globals = _PyFrame_GetGlobals(f); - PyCodeObject *code = PyFrame_GetCode(f); - *filename = code->co_filename; - Py_DECREF(code); + globals = f->f_frame->f_globals; + *filename = f->f_frame->f_code->co_filename; Py_INCREF(*filename); *lineno = PyFrame_GetLineNumber(f); Py_DECREF(f); |
