@@ -3404,8 +3404,9 @@ static void zend_jit_trace_setup_ret_counter(const zend_op *opline, size_t offse
3404
3404
}
3405
3405
}
3406
3406
3407
- static bool zend_jit_may_delay_fetch_this (zend_ssa * ssa , const zend_op * * ssa_opcodes , int var )
3407
+ static bool zend_jit_may_delay_fetch_this (const zend_op_array * op_array , zend_ssa * ssa , const zend_op * * ssa_opcodes , const zend_ssa_op * ssa_op )
3408
3408
{
3409
+ int var = ssa_op -> result_def ;
3409
3410
int i ;
3410
3411
int use = ssa -> vars [var ].use_chain ;
3411
3412
const zend_op * opline ;
@@ -3446,6 +3447,19 @@ static bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ssa_opc
3446
3447
return 0 ;
3447
3448
}
3448
3449
3450
+ if (opline -> opcode == ZEND_ASSIGN_OBJ_OP ) {
3451
+ if (opline -> op1_type == IS_CV
3452
+ && (opline + 1 )-> op1_type == IS_CV
3453
+ && (opline + 1 )-> op1 .var == opline -> op1 .var ) {
3454
+ /* skip $a->prop += $a; */
3455
+ return 0 ;
3456
+ }
3457
+ if (!zend_jit_supported_binary_op (
3458
+ opline -> extended_value , MAY_BE_ANY , OP1_DATA_INFO ())) {
3459
+ return 0 ;
3460
+ }
3461
+ }
3462
+
3449
3463
for (i = ssa -> vars [var ].definition ; i < use ; i ++ ) {
3450
3464
if (ssa_opcodes [i ]-> opcode == ZEND_DO_UCALL
3451
3465
|| ssa_opcodes [i ]-> opcode == ZEND_DO_FCALL_BY_NAME
@@ -5871,7 +5885,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5871
5885
case ZEND_FETCH_THIS :
5872
5886
delayed_fetch_this = 0 ;
5873
5887
if (ssa_op -> result_def >= 0 && opline -> result_type != IS_CV ) {
5874
- if (zend_jit_may_delay_fetch_this (ssa , ssa_opcodes , ssa_op -> result_def )) {
5888
+ if (zend_jit_may_delay_fetch_this (op_array , ssa , ssa_opcodes , ssa_op )) {
5875
5889
ssa -> var_info [ssa_op -> result_def ].delayed_fetch_this = 1 ;
5876
5890
delayed_fetch_this = 1 ;
5877
5891
}
0 commit comments