@@ -208,7 +208,7 @@ dummy_func(
208
208
BINARY_OP_ADD_FLOAT ,
209
209
BINARY_OP_ADD_INT ,
210
210
BINARY_OP_ADD_UNICODE ,
211
- _BINARY_OP_INPLACE_ADD_UNICODE_PART_1 ,
211
+ // BINARY_OP_INPLACE_ADD_UNICODE, // This is an odd duck.
212
212
BINARY_OP_MULTIPLY_FLOAT ,
213
213
BINARY_OP_MULTIPLY_INT ,
214
214
BINARY_OP_SUBTRACT_FLOAT ,
@@ -274,10 +274,13 @@ dummy_func(
274
274
ERROR_IF (res == NULL , error );
275
275
}
276
276
277
- // Part 1's output effect is a lie -- it has no result.
278
- // Part 2's input effect is equally a lie, and the two lies
279
- // cancel each other out.
280
- op (_BINARY_OP_INPLACE_ADD_UNICODE_PART_1 , (unused /1 , left , right -- unused )) {
277
+ // This is a subtle one. It's a super-instruction for
278
+ // BINARY_OP_ADD_UNICODE followed by STORE_FAST
279
+ // where the store goes into the left argument.
280
+ // So the inputs are the same as for all BINARY_OP
281
+ // specializations, but there is no output.
282
+ // At the end we just skip over the STORE_FAST.
283
+ inst (BINARY_OP_INPLACE_ADD_UNICODE , (left , right -- )) {
281
284
assert (cframe .use_tracing == 0 );
282
285
DEOPT_IF (!PyUnicode_CheckExact (left ), BINARY_OP );
283
286
DEOPT_IF (Py_TYPE (right ) != Py_TYPE (left ), BINARY_OP );
@@ -303,12 +306,9 @@ dummy_func(
303
306
PyUnicode_Append (target_local , right );
304
307
_Py_DECREF_SPECIALIZED (right , _PyUnicode_ExactDealloc );
305
308
ERROR_IF (* target_local == NULL , error );
309
+ // The STORE_FAST is already done.
310
+ JUMPBY (INLINE_CACHE_ENTRIES_BINARY_OP + 1 );
306
311
}
307
- op (_BINARY_OP_INPLACE_ADD_UNICODE_PART_2 , (unused -- )) {
308
- // The STORE_FAST is already done; oparg is dead.
309
- }
310
- super (BINARY_OP_INPLACE_ADD_UNICODE ) =
311
- _BINARY_OP_INPLACE_ADD_UNICODE_PART_1 + _BINARY_OP_INPLACE_ADD_UNICODE_PART_2 ;
312
312
313
313
inst (BINARY_OP_ADD_FLOAT , (unused /1 , left , right -- sum )) {
314
314
assert (cframe .use_tracing == 0 );
0 commit comments