summaryrefslogtreecommitdiffstats
path: root/Python/optimizer.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2024-07-25 21:45:07 (GMT)
committerGitHub <noreply@github.com>2024-07-25 21:45:07 (GMT)
commitd9efa45d7457b0dfea467bb1c2d22c69056ffc73 (patch)
tree82176acb7bdce074599d58ba0e82df86fc15f4dc /Python/optimizer.c
parent1d607fe759ef22177b50d734ae029df3903c99e0 (diff)
downloadcpython-d9efa45d7457b0dfea467bb1c2d22c69056ffc73.zip
cpython-d9efa45d7457b0dfea467bb1c2d22c69056ffc73.tar.gz
cpython-d9efa45d7457b0dfea467bb1c2d22c69056ffc73.tar.bz2
GH-118093: Add tier two support for BINARY_OP_INPLACE_ADD_UNICODE (GH-122253)
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r--Python/optimizer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index e08c1dc..f0793b8 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -875,6 +875,15 @@ top: // Jump here after _PUSH_FRAME or likely branches
goto done;
}
+ if (uop == _BINARY_OP_INPLACE_ADD_UNICODE) {
+ assert(i + 1 == nuops);
+ _Py_CODEUNIT *next_instr = instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
+ assert(next_instr->op.code == STORE_FAST);
+ operand = next_instr->op.arg;
+ // Skip the STORE_FAST:
+ instr++;
+ }
+
// All other instructions
ADD_TO_TRACE(uop, oparg, operand, target);
}