]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44590: Lazily allocate frame objects (GH-27077)
authorMark Shannon <mark@hotpy.org>
Mon, 26 Jul 2021 10:22:16 +0000 (11:22 +0100)
committerGitHub <noreply@github.com>
Mon, 26 Jul 2021 10:22:16 +0000 (11:22 +0100)
commitae0a2b756255629140efcbe57fc2e714f0267aa3
tree8710e8c7a398c9ec0add227fab607f367242a7e5
parent0363a4014d90df17a29042de008ef0b659f92505
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.
27 files changed:
Include/cpython/ceval.h
Include/cpython/frameobject.h
Include/cpython/pystate.h
Include/genobject.h
Include/internal/pycore_ceval.h
Include/internal/pycore_frame.h
Include/internal/pycore_pystate.h
Lib/test/test_faulthandler.py
Lib/test/test_sys.py
Makefile.pre.in
Misc/NEWS.d/next/Core and Builtins/2021-07-09-12-08-17.bpo-44590.a2ntVX.rst [new file with mode: 0644]
Modules/_tracemalloc.c
Modules/_xxsubinterpretersmodule.c
Modules/signalmodule.c
Objects/frameobject.c
Objects/genobject.c
Objects/typeobject.c
PCbuild/pythoncore.vcxproj
Python/_warnings.c
Python/ceval.c
Python/errors.c
Python/frame.c [new file with mode: 0644]
Python/pystate.c
Python/suggestions.c
Python/sysmodule.c
Python/traceback.c
Tools/gdb/libpython.py