Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make POP_JUMP_IF_FALSE/TRUE conditionally jump
This may destroy the symmetry or slow things down,
but (for now) it's needed so that the executor can
at least avoid bailing when the jump is not taken.
(The original code was doing a jump 0 in that case.)
  • Loading branch information
gvanrossum committed Jul 7, 2023
commit 0825696ffaac8ad46da80beea49c337c248d2c38
8 changes: 6 additions & 2 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2273,12 +2273,16 @@ dummy_func(

inst(POP_JUMP_IF_FALSE, (cond -- )) {
assert(PyBool_Check(cond));
JUMP_POP_DISPATCH(oparg * Py_IsFalse(cond), 1);
if (Py_IsFalse(cond)) {
JUMP_POP_DISPATCH(oparg, 1);
}
}

inst(POP_JUMP_IF_TRUE, (cond -- )) {
assert(PyBool_Check(cond));
JUMP_POP_DISPATCH(oparg * Py_IsTrue(cond), 1);
if (Py_IsTrue(cond)) {
JUMP_POP_DISPATCH(oparg, 1);
}
}

inst(POP_JUMP_IF_NOT_NONE, (value -- )) {
Expand Down
Loading