@@ -389,32 +389,20 @@ static zend_always_inline int zend_jit_var_may_be_modified_indirectly(const zend
389
389
} \
390
390
} while (0)
391
391
392
- #define USE_OP_TRACE_TYPE (_type , _var , op_info ) do { \
393
- if (_type & (IS_TMP_VAR|IS_VAR|IS_CV)) { \
394
- op_info = zend_jit_trace_type_to_info_ex(STACK_VAR_TYPE(_var), op_info); \
395
- } \
396
- } while (0)
397
-
398
392
#define ADD_OP1_TRACE_GUARD () \
399
393
ADD_OP_GUARD(tssa->ops[idx].op1_use, op1_type)
400
394
#define ADD_OP2_TRACE_GUARD () \
401
395
ADD_OP_GUARD(tssa->ops[idx].op2_use, op2_type)
402
396
#define ADD_OP1_DATA_TRACE_GUARD () \
403
397
ADD_OP_GUARD(tssa->ops[idx+1].op1_use, op3_type)
398
+
404
399
#define CHECK_OP1_TRACE_TYPE () \
405
400
CHECK_OP_TRACE_TYPE(opline->op1.var, ssa_op->op1_use, op1_info, op1_type)
406
401
#define CHECK_OP2_TRACE_TYPE () \
407
402
CHECK_OP_TRACE_TYPE(opline->op2.var, ssa_op->op2_use, op2_info, op2_type)
408
403
#define CHECK_OP1_DATA_TRACE_TYPE () \
409
404
CHECK_OP_TRACE_TYPE((opline+1)->op1.var, (ssa_op+1)->op1_use, op1_data_info, op3_type)
410
- #define USE_OP1_TRACE_TYPE () \
411
- USE_OP_TRACE_TYPE(opline->op1_type, opline->op1.var, op1_info)
412
- #define USE_OP2_TRACE_TYPE () \
413
- USE_OP_TRACE_TYPE(opline->op2_type, opline->op2.var, op2_info)
414
- #define USE_OP1_DATA_TRACE_TYPE () \
415
- USE_OP_TRACE_TYPE((opline+1)->op1_type, (opline+1)->op1.var, op1_data_info)
416
- #define USE_RES_TRACE_TYPE () \
417
- USE_OP_TRACE_TYPE(opline->result_type, opline->result.var, res_use_info)
405
+
418
406
#define SET_OP1_STACK_VAR_TYPE (_type ) \
419
407
SET_STACK_VAR_TYPE(opline->op1.var, _type)
420
408
#define SET_OP2_STACK_VAR_TYPE ( _type ) \
@@ -3091,8 +3079,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3091
3079
break ;
3092
3080
}
3093
3081
if (opline -> result_type != IS_UNUSED ) {
3094
- res_use_info = RES_USE_INFO ();
3095
- USE_RES_TRACE_TYPE ();
3082
+ if (opline -> result_type == IS_CV ) {
3083
+ res_use_info = RES_USE_INFO ();
3084
+ } else {
3085
+ res_use_info = zend_jit_trace_type_to_info (STACK_VAR_TYPE (opline -> result .var ));
3086
+ }
3096
3087
res_info = RES_INFO ();
3097
3088
res_addr = RES_REG_ADDR ();
3098
3089
} else {
@@ -3163,8 +3154,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3163
3154
res_addr = 0 ; /* set inside backend */
3164
3155
} else {
3165
3156
send_result = 0 ;
3166
- res_use_info = RES_USE_INFO ();
3167
- USE_RES_TRACE_TYPE ();
3157
+ if (opline -> result_type == IS_CV ) {
3158
+ res_use_info = RES_USE_INFO ();
3159
+ } else {
3160
+ res_use_info = zend_jit_trace_type_to_info (STACK_VAR_TYPE (opline -> result .var ));
3161
+ }
3168
3162
res_addr = RES_REG_ADDR ();
3169
3163
}
3170
3164
res_info = RES_INFO ();
@@ -3227,8 +3221,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3227
3221
res_addr = 0 ; /* set inside backend */
3228
3222
} else {
3229
3223
send_result = 0 ;
3230
- res_use_info = RES_USE_INFO ();
3231
- USE_RES_TRACE_TYPE ();
3224
+ if (opline -> result_type == IS_CV ) {
3225
+ res_use_info = RES_USE_INFO ();
3226
+ } else {
3227
+ res_use_info = zend_jit_trace_type_to_info (STACK_VAR_TYPE (opline -> result .var ));
3228
+ }
3232
3229
res_addr = RES_REG_ADDR ();
3233
3230
}
3234
3231
res_info = RES_INFO ();
@@ -3426,19 +3423,17 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3426
3423
op1_def_info = OP1_DEF_INFO ();
3427
3424
op1_addr = OP1_REG_ADDR ();
3428
3425
op1_def_addr = OP1_DEF_REG_ADDR ();
3429
- if (orig_op1_type != IS_UNKNOWN
3430
- && (orig_op1_type & IS_TRACE_REFERENCE )) {
3431
- if (!zend_jit_fetch_reference (& dasm_state , opline , orig_op1_type , & op1_info , & op1_addr , 0 )) {
3432
- goto jit_failure ;
3433
- }
3434
- if (!zend_jit_assign_to_typed_ref (& dasm_state , opline , op_array , opline -> op2_type , op2_addr , 1 )) {
3435
- goto jit_failure ;
3436
- }
3437
- op1_def_addr = op1_addr ;
3438
- } else {
3439
- USE_OP1_TRACE_TYPE ();
3440
- if (orig_op1_type != IS_UNKNOWN
3441
- && (op1_info & MAY_BE_REF )) {
3426
+ if (orig_op1_type != IS_UNKNOWN ) {
3427
+ if (orig_op1_type & IS_TRACE_REFERENCE ) {
3428
+ if (!zend_jit_fetch_reference (& dasm_state , opline , orig_op1_type , & op1_info , & op1_addr , 0 )) {
3429
+ goto jit_failure ;
3430
+ }
3431
+ if (!zend_jit_assign_to_typed_ref (& dasm_state , opline , op_array , opline -> op2_type , op2_addr , 1 )) {
3432
+ goto jit_failure ;
3433
+ }
3434
+ op1_def_addr = op1_addr ;
3435
+ op1_def_info &= ~MAY_BE_REF ;
3436
+ } else if (op1_info & MAY_BE_REF ) {
3442
3437
if (!zend_jit_noref_guard (& dasm_state , opline , op1_addr )) {
3443
3438
goto jit_failure ;
3444
3439
}
@@ -3470,7 +3465,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3470
3465
op1_def_addr = op1_addr ;
3471
3466
}
3472
3467
op1_info = OP1_INFO ();
3473
- CHECK_OP1_TRACE_TYPE ();//???USE_OP1_TRACE_TYPE();
3468
+ CHECK_OP1_TRACE_TYPE ();
3474
3469
res_info = RES_INFO ();
3475
3470
if (!zend_jit_qm_assign (& dasm_state , opline , op_array ,
3476
3471
op1_info , op1_addr , op1_def_addr ,
@@ -3492,7 +3487,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3492
3487
break ;
3493
3488
}
3494
3489
op1_info = OP1_INFO ();
3495
- CHECK_OP1_TRACE_TYPE (); //???USE_OP1_TRACE_TYPE();
3490
+ CHECK_OP1_TRACE_TYPE ();
3496
3491
if (!zend_jit_send_val (& dasm_state , opline , op_array ,
3497
3492
op1_info , OP1_REG_ADDR ())) {
3498
3493
goto jit_failure ;
@@ -3512,7 +3507,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3512
3507
goto done ;
3513
3508
case ZEND_SEND_REF :
3514
3509
op1_info = OP1_INFO ();
3515
- USE_OP1_TRACE_TYPE ();
3516
3510
if (!zend_jit_send_ref (& dasm_state , opline , op_array ,
3517
3511
op1_info , 0 )) {
3518
3512
goto jit_failure ;
@@ -3537,7 +3531,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3537
3531
op1_def_addr = op1_addr ;
3538
3532
}
3539
3533
op1_info = OP1_INFO ();
3540
- CHECK_OP1_TRACE_TYPE (); //???USE_OP1_TRACE_TYPE();
3534
+ CHECK_OP1_TRACE_TYPE ();
3541
3535
if (!zend_jit_send_var (& dasm_state , opline , op_array ,
3542
3536
op1_info , op1_addr , op1_def_addr )) {
3543
3537
goto jit_failure ;
@@ -3674,7 +3668,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
3674
3668
break ;
3675
3669
}
3676
3670
op1_info = OP1_INFO ();
3677
- USE_OP1_TRACE_TYPE ();
3678
3671
if ((opline -> result_type & (IS_SMART_BRANCH_JMPZ |IS_SMART_BRANCH_JMPNZ )) != 0 ) {
3679
3672
zend_bool exit_if_true = 0 ;
3680
3673
const zend_op * exit_opline = zend_jit_trace_get_exit_opline (p + 1 , opline + 1 , & exit_if_true );
@@ -4038,7 +4031,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
4038
4031
case ZEND_FREE :
4039
4032
case ZEND_FE_FREE :
4040
4033
op1_info = OP1_INFO ();
4041
- USE_OP1_TRACE_TYPE ();
4042
4034
if (!zend_jit_free (& dasm_state , opline , op_array , op1_info ,
4043
4035
zend_may_throw (opline , ssa_op , op_array , ssa ))) {
4044
4036
goto jit_failure ;
0 commit comments