@@ -3147,8 +3147,9 @@ static void zend_jit_trace_setup_ret_counter(const zend_op *opline, size_t offse
3147
3147
}
3148
3148
}
3149
3149
3150
- static zend_bool zend_jit_may_delay_fetch_this (zend_ssa * ssa , const zend_op * * ssa_opcodes , int var )
3150
+ static zend_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 )
3151
3151
{
3152
+ int var = ssa_op -> result_def ;
3152
3153
int i ;
3153
3154
int use = ssa -> vars [var ].use_chain ;
3154
3155
const zend_op * opline ;
@@ -3189,6 +3190,19 @@ static zend_bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ss
3189
3190
return 0 ;
3190
3191
}
3191
3192
3193
+ if (opline -> opcode == ZEND_ASSIGN_OBJ_OP ) {
3194
+ if (opline -> op1_type == IS_CV
3195
+ && (opline + 1 )-> op1_type == IS_CV
3196
+ && (opline + 1 )-> op1 .var == opline -> op1 .var ) {
3197
+ /* skip $a->prop += $a; */
3198
+ return 0 ;
3199
+ }
3200
+ if (!zend_jit_supported_binary_op (
3201
+ opline -> extended_value , MAY_BE_ANY , OP1_DATA_INFO ())) {
3202
+ return 0 ;
3203
+ }
3204
+ }
3205
+
3192
3206
for (i = ssa -> vars [var ].definition ; i < use ; i ++ ) {
3193
3207
if (ssa_opcodes [i ]-> opcode == ZEND_DO_UCALL
3194
3208
|| ssa_opcodes [i ]-> opcode == ZEND_DO_FCALL_BY_NAME
@@ -5610,7 +5624,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5610
5624
case ZEND_FETCH_THIS :
5611
5625
delayed_fetch_this = 0 ;
5612
5626
if (ssa_op -> result_def >= 0 && opline -> result_type != IS_CV ) {
5613
- if (zend_jit_may_delay_fetch_this (ssa , ssa_opcodes , ssa_op -> result_def )) {
5627
+ if (zend_jit_may_delay_fetch_this (op_array , ssa , ssa_opcodes , ssa_op )) {
5614
5628
ssa -> var_info [ssa_op -> result_def ].delayed_fetch_this = 1 ;
5615
5629
delayed_fetch_this = 1 ;
5616
5630
}
0 commit comments