aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/compile.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-01-11 20:40:43 +0000
committerGitHub <noreply@github.com>2023-01-11 20:40:43 +0000
commit6e4e14d98fe0868981f29701496d57a8223c5407 (patch)
treed97f9422c02a791511267bf5af45071067d1c848 /Python/compile.c
parent61f12b8ff7073064040ff0e6220150408d24829b (diff)
downloadcpython-6e4e14d98fe0868981f29701496d57a8223c5407.tar.gz
cpython-6e4e14d98fe0868981f29701496d57a8223c5407.zip
GH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 943168ba693..c0177fbf3e3 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2887,7 +2887,9 @@ static int compiler_addcompare(struct compiler *c, location loc,
default:
Py_UNREACHABLE();
}
- ADDOP_I(c, loc, COMPARE_OP, cmp);
+ /* cmp goes in top bits of the oparg, while the low bits are used by quickened
+ * versions of this opcode to store the comparison mask. */
+ ADDOP_I(c, loc, COMPARE_OP, cmp << 4);
return SUCCESS;
}