@@ -5687,8 +5687,23 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5687
5687
if (type != IS_UNKNOWN ) {
5688
5688
ssa -> var_info [ssa_op -> op1_def ].type &= ~MAY_BE_GUARD ;
5689
5689
if (ra && ra [ssa_op -> op1_def ]) {
5690
- SET_STACK_REG_EX (stack , EX_VAR_TO_NUM (opline -> op1 .var ), ra [ssa_op -> op1_def ]-> reg ,
5691
- ra [ssa_op -> op1_def ]-> flags & ZREG_STORE );
5690
+ uint8_t flags = ra [ssa_op -> op1_def ]-> flags & ZREG_STORE ;
5691
+
5692
+ if (ssa_op -> op1_use >= 0 ) {
5693
+ if (opline -> opcode == ZEND_SEND_VAR
5694
+ || opline -> opcode == ZEND_CAST
5695
+ || opline -> opcode == ZEND_QM_ASSIGN
5696
+ || opline -> opcode == ZEND_JMP_SET
5697
+ || opline -> opcode == ZEND_COALESCE
5698
+ || opline -> opcode == ZEND_JMP_NULL
5699
+ || opline -> opcode == ZEND_FE_RESET_R ) {
5700
+ if (!ra [ssa_op -> op1_use ]
5701
+ || ra [ssa_op -> op1_use ]-> reg != ra [ssa_op -> op1_def ]-> reg ) {
5702
+ flags |= ZREG_LOAD ;
5703
+ }
5704
+ }
5705
+ }
5706
+ SET_STACK_REG_EX (stack , EX_VAR_TO_NUM (opline -> op1 .var ), ra [ssa_op -> op1_def ]-> reg , flags );
5692
5707
}
5693
5708
}
5694
5709
if (type == IS_LONG
@@ -5715,8 +5730,17 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
5715
5730
if (type != IS_UNKNOWN ) {
5716
5731
ssa -> var_info [ssa_op -> op2_def ].type &= ~MAY_BE_GUARD ;
5717
5732
if (ra && ra [ssa_op -> op2_def ]) {
5718
- SET_STACK_REG_EX (stack , EX_VAR_TO_NUM (opline -> op2 .var ), ra [ssa_op -> op2_def ]-> reg ,
5719
- ra [ssa_op -> op2_def ]-> flags & ZREG_STORE );
5733
+ uint8_t flags = ra [ssa_op -> op2_def ]-> flags & ZREG_STORE ;
5734
+
5735
+ if (ssa_op -> op2_use >= 0 ) {
5736
+ if (opline -> opcode == ZEND_ASSIGN ) {
5737
+ if (!ra [ssa_op -> op2_use ]
5738
+ || ra [ssa_op -> op2_use ]-> reg != ra [ssa_op -> op2_def ]-> reg ) {
5739
+ flags |= ZREG_LOAD ;
5740
+ }
5741
+ }
5742
+ }
5743
+ SET_STACK_REG_EX (stack , EX_VAR_TO_NUM (opline -> op2 .var ), ra [ssa_op -> op2_def ]-> reg , flags );
5720
5744
}
5721
5745
}
5722
5746
if (type == IS_LONG
0 commit comments