Skip to content

Commit ba64a5b

Browse files
Support BINARY_OP_INPLACE_ADD_UNICODE
1 parent 00c81fa commit ba64a5b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Python/optimizer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,6 @@ _PyJIT_translate_single_bytecode_to_trace(
615615
// If we haven't guarded the IP, then it's untraceable.
616616
(frame != tstate->interp->jit_state.jit_tracer_current_frame && !needs_guard_ip) ||
617617
(oparg > 0xFFFF) ||
618-
// TODO handle BINARY_OP_INPLACE_ADD_UNICODE
619-
opcode == BINARY_OP_INPLACE_ADD_UNICODE ||
620618
// TODO (gh-140277): The constituent uops are invalid.
621619
opcode == BINARY_OP_SUBSCR_GETITEM ||
622620
// Exception stuff, could be handled in the future maybe?
@@ -838,6 +836,12 @@ _PyJIT_translate_single_bytecode_to_trace(
838836
operand = 0;
839837
}
840838
}
839+
if (uop == _BINARY_OP_INPLACE_ADD_UNICODE) {
840+
assert(i + 1 == nuops);
841+
_Py_CODEUNIT *next_instr = target_instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
842+
assert(next_instr->op.code == STORE_FAST);
843+
operand = next_instr->op.arg;
844+
}
841845
// All other instructions
842846
ADD_TO_TRACE(uop, oparg, operand, target);
843847
}

0 commit comments

Comments
 (0)