gh-134584: Remove redundant refcount from _BINARY_OP_ADD_UNICODE (gh-142825)

This commit is contained in:
Donghee Na 2025-12-18 21:33:18 +09:00 committed by GitHub
parent fc80096a07
commit 71a7cb8887
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 859 additions and 831 deletions

View file

@ -298,12 +298,14 @@ dummy_func(void) {
r = right;
}
op(_BINARY_OP_ADD_UNICODE, (left, right -- res)) {
op(_BINARY_OP_ADD_UNICODE, (left, right -- res, l, r)) {
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right);
res = sym_new_type(ctx, &PyUnicode_Type);
l = left;
r = right;
}
op(_BINARY_OP_INPLACE_ADD_UNICODE, (left, right -- )) {
op(_BINARY_OP_INPLACE_ADD_UNICODE, (left, right --)) {
JitOptRef res;
if (sym_is_const(ctx, left) && sym_is_const(ctx, right)) {
assert(PyUnicode_CheckExact(sym_get_const(ctx, left)));
@ -563,6 +565,12 @@ dummy_func(void) {
}
}
op(_POP_TOP_UNICODE, (value --)) {
if (PyJitRef_IsBorrowed(value)) {
REPLACE_OP(this_instr, _POP_TOP_NOP, 0, 0);
}
}
op(_COPY, (bottom, unused[oparg-1] -- bottom, unused[oparg-1], top)) {
assert(oparg > 0);
top = bottom;