@@ -3417,8 +3417,9 @@ static void zend_jit_trace_setup_ret_counter(const zend_op *opline, size_t offse
3417
3417
}
3418
3418
}
3419
3419
3420
- static bool zend_jit_may_delay_fetch_this (zend_ssa * ssa , const zend_op * * ssa_opcodes , int var )
3420
+ 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 )
3421
3421
{
3422
+ int var = ssa_op -> result_def ;
3422
3423
int i ;
3423
3424
int use = ssa -> vars [var ].use_chain ;
3424
3425
const zend_op * opline ;
@@ -3459,6 +3460,19 @@ static bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ssa_opc
3459
3460
return 0 ;
3460
3461
}
3461
3462
3463
+ if (opline -> opcode == ZEND_ASSIGN_OBJ_OP ) {
3464
+ if (opline -> op1_type == IS_CV
3465
+ && (opline + 1 )-> op1_type == IS_CV
3466
+ && (opline + 1 )-> op1 .var == opline -> op1 .var ) {
3467
+ /* skip $a->prop += $a; */
3468
+ return 0 ;
3469
+ }
3470
+ if (!zend_jit_supported_binary_op (
3471
+ opline -> extended_value , MAY_BE_ANY , OP1_DATA_INFO ())) {
3472
+ return 0 ;
3473
+ }
3474
+ }
3475
+
3462
3476
for (i = ssa -> vars [var ].definition ; i < use ; i ++ ) {
3463
3477
if (ssa_opcodes [i ]-> opcode == ZEND_DO_UCALL
3464
3478
|| ssa_opcodes [i ]-> opcode == ZEND_DO_FCALL_BY_NAME
@@ -5884,7 +5898,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5884
5898
case ZEND_FETCH_THIS :
5885
5899
delayed_fetch_this = 0 ;
5886
5900
if (ssa_op -> result_def >= 0 && opline -> result_type != IS_CV ) {
5887
- if (zend_jit_may_delay_fetch_this (ssa , ssa_opcodes , ssa_op -> result_def )) {
5901
+ if (zend_jit_may_delay_fetch_this (op_array , ssa , ssa_opcodes , ssa_op )) {
5888
5902
ssa -> var_info [ssa_op -> result_def ].delayed_fetch_this = 1 ;
5889
5903
delayed_fetch_this = 1 ;
5890
5904
}
0 commit comments