summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2023-07-11 22:13:57 (GMT)
committerGitHub <noreply@github.com>2023-07-11 22:13:57 (GMT)
commitda86db56cb595fdbeda8b57a1ec03b1dd80ad1f0 (patch)
tree64fe2ff2a6c9dfad7c839dcbde9354d0b3cfedca /Python
parentd0972c77aa1cd5fe27618e82c10141a2bf157476 (diff)
downloadcpython-da86db56cb595fdbeda8b57a1ec03b1dd80ad1f0.zip
cpython-da86db56cb595fdbeda8b57a1ec03b1dd80ad1f0.tar.gz
cpython-da86db56cb595fdbeda8b57a1ec03b1dd80ad1f0.tar.bz2
gh-106529: Implement JUMP_FORWARD in uops (with test) (#106651)
Note that this may generate two SAVE_IP uops in a row. Removing unneeded SAVE_IP uops is the optimizer's job.
Diffstat (limited to 'Python')
-rw-r--r--Python/optimizer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index e2b92e6..7fc40e6 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -472,6 +472,13 @@ translate_bytecode_to_trace(
goto done;
}
+ case JUMP_FORWARD:
+ {
+ // This will emit two SAVE_IP instructions; leave it to the optimizer
+ instr += oparg;
+ break;
+ }
+
default:
{
const struct opcode_macro_expansion *expansion = &_PyOpcode_macro_expansion[opcode];