]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-106529: Support JUMP_BACKWARD in Tier 2 (uops) (#106543)
authorGuido van Rossum <guido@python.org>
Tue, 11 Jul 2023 18:08:10 +0000 (11:08 -0700)
committerGitHub <noreply@github.com>
Tue, 11 Jul 2023 18:08:10 +0000 (18:08 +0000)
commitcabd6e8a107127ff02f0b514148f648fb2472a58
tree503576bebc0f89d59bc198bb7d54f6284737b5b9
parent292ac4bfe92768140c2d383fd329cfa1949869b2
gh-106529: Support JUMP_BACKWARD in Tier 2 (uops) (#106543)

During superblock generation, a JUMP_BACKWARD instruction is translated to either a JUMP_TO_TOP micro-op (when the target of the jump is exactly the beginning of the superblock, closing the loop), or a SAVE_IP + EXIT_TRACE pair, when the jump goes elsewhere.

The new JUMP_TO_TOP instruction includes a CHECK_EVAL_BREAKER() call, so a closed loop can still be interrupted.
Lib/test/test_capi/test_misc.py
Python/ceval.c
Python/opcode_metadata.h
Python/optimizer.c
Tools/cases_generator/generate_cases.py