From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Mon, 20 Oct 2025 01:37:40 +0000 (+0100) Subject: Support BINARY_OP_INPLACE_ADD_UNICODE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba64a5ba4a640753c286296ed41d92642a8b3405;p=thirdparty%2FPython%2Fcpython.git Support BINARY_OP_INPLACE_ADD_UNICODE --- diff --git a/Python/optimizer.c b/Python/optimizer.c index a11244d4b54f..24e3d0614a2a 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -615,8 +615,6 @@ _PyJIT_translate_single_bytecode_to_trace( // If we haven't guarded the IP, then it's untraceable. (frame != tstate->interp->jit_state.jit_tracer_current_frame && !needs_guard_ip) || (oparg > 0xFFFF) || - // TODO handle BINARY_OP_INPLACE_ADD_UNICODE - opcode == BINARY_OP_INPLACE_ADD_UNICODE || // TODO (gh-140277): The constituent uops are invalid. opcode == BINARY_OP_SUBSCR_GETITEM || // Exception stuff, could be handled in the future maybe? @@ -838,6 +836,12 @@ _PyJIT_translate_single_bytecode_to_trace( operand = 0; } } + if (uop == _BINARY_OP_INPLACE_ADD_UNICODE) { + assert(i + 1 == nuops); + _Py_CODEUNIT *next_instr = target_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]]; + assert(next_instr->op.code == STORE_FAST); + operand = next_instr->op.arg; + } // All other instructions ADD_TO_TRACE(uop, oparg, operand, target); }