]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-106529: Make FOR_ITER a viable uop (#112134)
authorGuido van Rossum <guido@python.org>
Mon, 20 Nov 2023 18:08:53 +0000 (10:08 -0800)
committerGitHub <noreply@github.com>
Mon, 20 Nov 2023 18:08:53 +0000 (10:08 -0800)
commit1995955173737bcb009dbacaeff7821b4d744148
tree96a6c3f5901c4ed2c4cf5fa205231f7216a6e9c1
parentd59feb5dbe5395615d06c30a95e6a6a9b7681d4d
gh-106529: Make FOR_ITER a viable uop (#112134)

This uses the new mechanism whereby certain uops
are replaced by others during translation,
using the `_PyUop_Replacements` table.
We further special-case the `_FOR_ITER_TIER_TWO` uop
to update the deoptimization target to point
just past the corresponding `END_FOR` opcode.

Two tiny code cleanups are also part of this PR.
Include/internal/pycore_opcode_metadata.h
Lib/test/test_capi/test_misc.py
Misc/NEWS.d/next/Core and Builtins/2023-11-15-16-14-10.gh-issue-106529.Y48ax9.rst [new file with mode: 0644]
Python/abstract_interp_cases.c.h
Python/bytecodes.c
Python/ceval.c
Python/executor_cases.c.h
Python/optimizer.c