diff options
author | Mark Shannon <mark@hotpy.org> | 2023-01-11 20:40:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 20:40:43 +0000 |
commit | 6e4e14d98fe0868981f29701496d57a8223c5407 (patch) | |
tree | d97f9422c02a791511267bf5af45071067d1c848 /Python/compile.c | |
parent | 61f12b8ff7073064040ff0e6220150408d24829b (diff) | |
download | cpython-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.c | 4 |
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; } |