]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40222: "Zero cost" exception handling (GH-25729)
authorMark Shannon <mark@hotpy.org>
Fri, 7 May 2021 14:19:19 +0000 (15:19 +0100)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 14:19:19 +0000 (15:19 +0100)
commitadcd2205565f91c6719f4141ab4e1da6d7086126
tree0953b285944eccde57b05b8f3c7e30fb501a3d64
parentb32c8e97951db46484ba3b646b988bcdc4062199
bpo-40222: "Zero cost" exception handling (GH-25729)

"Zero cost" exception handling.

* Uses a lookup table to determine how to handle exceptions.
* Removes SETUP_FINALLY and POP_TOP block instructions, eliminating (most of) the runtime overhead of try statements.
* Reduces the size of the frame object by about 60%.
30 files changed:
Doc/library/dis.rst
Doc/whatsnew/3.11.rst
Include/cpython/code.h
Include/cpython/frameobject.h
Include/opcode.h
Lib/ctypes/test/test_values.py
Lib/dis.py
Lib/importlib/_bootstrap_external.py
Lib/opcode.py
Lib/test/test_code.py
Lib/test/test_dis.py
Lib/test/test_exceptions.py
Lib/test/test_sys.py
Lib/test/test_sys_settrace.py
Misc/NEWS.d/next/Core and Builtins/2021-04-30-15-48-36.bpo-40222.j3VxeX.rst [new file with mode: 0644]
Modules/_opcode.c
Objects/clinic/codeobject.c.h
Objects/codeobject.c
Objects/exception_handling_notes.txt [new file with mode: 0644]
Objects/frameobject.c
PC/launcher.c
Python/ceval.c
Python/compile.c
Python/frozen_hello.h
Python/importlib.h
Python/importlib_external.h
Python/importlib_zipimport.h
Python/marshal.c
Python/opcode_targets.h
Tools/scripts/generate_opcode_h.py