@@ -1022,7 +1022,7 @@ static void* dasm_labels[zend_lb_MAX];
1022
1022
|.endmacro
1023
1023
1024
1024
/* the same as above, but "src" may overlap with "tmp_reg1" */
1025
- |.macro ZVAL_COPY_VALUE, dst_addr, dst_info, src_addr, src_info, tmp_reg1, tmp_reg2, src_loaded
1025
+ |.macro ZVAL_COPY_VALUE, dst_addr, dst_info, src_addr, src_info, tmp_reg1, tmp_reg2
1026
1026
|| if (src_info & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE))) {
1027
1027
|| if ((src_info & MAY_BE_ANY) == MAY_BE_LONG) {
1028
1028
|| if (Z_MODE(src_addr) == IS_REG) {
@@ -1032,9 +1032,7 @@ static void* dasm_labels[zend_lb_MAX];
1032
1032
|| } else if (Z_MODE(dst_addr) == IS_REG) {
1033
1033
| GET_ZVAL_LVAL Z_REG(dst_addr), src_addr
1034
1034
|| } else {
1035
- || if (!src_loaded) {
1036
- | GET_ZVAL_LVAL tmp_reg2, src_addr
1037
- || }
1035
+ | GET_ZVAL_LVAL tmp_reg2, src_addr
1038
1036
| SET_ZVAL_LVAL dst_addr, Ra(tmp_reg2)
1039
1037
|| }
1040
1038
|| } else if ((src_info & MAY_BE_ANY) == MAY_BE_DOUBLE) {
@@ -1047,26 +1045,20 @@ static void* dasm_labels[zend_lb_MAX];
1047
1045
| SSE_SET_ZVAL_DVAL dst_addr, ZREG_XMM0
1048
1046
|| }
1049
1047
|| } else if (!(src_info & MAY_BE_DOUBLE)) {
1050
- || if (!src_loaded) {
1051
- | GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1052
- || }
1048
+ | GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1053
1049
| SET_ZVAL_PTR dst_addr, Ra(tmp_reg2)
1054
1050
|| } else {
1055
1051
| .if X64
1056
- || if (!src_loaded) {
1057
- | GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1058
- || }
1052
+ | GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1059
1053
| SET_ZVAL_PTR dst_addr, Ra(tmp_reg2)
1060
1054
| .else
1061
- || if ((tmp_reg1 == tmp_reg2 || tmp_reg1 == Z_REG(src_addr)) && !src_loaded ) {
1055
+ || if ((tmp_reg1 == tmp_reg2 || tmp_reg1 == Z_REG(src_addr))) {
1062
1056
| GET_ZVAL_W2 Ra(tmp_reg2), src_addr
1063
1057
| SET_ZVAL_W2 dst_addr, Ra(tmp_reg2)
1064
1058
| GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1065
1059
| SET_ZVAL_PTR dst_addr, Ra(tmp_reg2)
1066
1060
|| } else {
1067
- || if (!src_loaded) {
1068
- | GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1069
- || }
1061
+ | GET_ZVAL_PTR Ra(tmp_reg2), src_addr
1070
1062
| GET_ZVAL_W2 Ra(tmp_reg1), src_addr
1071
1063
| SET_ZVAL_PTR dst_addr, Ra(tmp_reg2)
1072
1064
| SET_ZVAL_W2 dst_addr, Ra(tmp_reg1)
@@ -3559,7 +3551,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3559
3551
| IF_NOT_ZVAL_TYPE op1_addr, IS_LONG, >2
3560
3552
}
3561
3553
if (opline->opcode == ZEND_POST_INC || opline->opcode == ZEND_POST_DEC) {
3562
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1, 0
3554
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1
3563
3555
}
3564
3556
if (!zend_jit_update_regs(Dst, op1_addr, op1_def_addr, MAY_BE_LONG)) {
3565
3557
return 0;
@@ -3609,7 +3601,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3609
3601
3610
3602
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
3611
3603
opline->result_type != IS_UNUSED) {
3612
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1, 0
3604
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1
3613
3605
}
3614
3606
3615
3607
SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->op1.var), old_op1_info);
@@ -3620,7 +3612,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3620
3612
| jo >1
3621
3613
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
3622
3614
opline->result_type != IS_UNUSED) {
3623
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1, 0
3615
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1
3624
3616
}
3625
3617
|.cold_code
3626
3618
|1:
@@ -3646,14 +3638,14 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3646
3638
}
3647
3639
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
3648
3640
opline->result_type != IS_UNUSED) {
3649
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_DOUBLE, ZREG_R0, ZREG_R1, 0
3641
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_DOUBLE, ZREG_R0, ZREG_R1
3650
3642
}
3651
3643
| jmp >3
3652
3644
|.code
3653
3645
} else {
3654
3646
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
3655
3647
opline->result_type != IS_UNUSED) {
3656
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1, 0
3648
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_LONG, ZREG_R0, ZREG_R1
3657
3649
}
3658
3650
}
3659
3651
if (op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-MAY_BE_LONG)) {
@@ -3715,7 +3707,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3715
3707
if (opline->opcode == ZEND_POST_INC || opline->opcode == ZEND_POST_DEC) {
3716
3708
zend_jit_addr val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 0);
3717
3709
3718
- | ZVAL_COPY_VALUE res_addr, res_use_info, val_addr, op1_info, ZREG_R0, ZREG_R2, 0
3710
+ | ZVAL_COPY_VALUE res_addr, res_use_info, val_addr, op1_info, ZREG_R0, ZREG_R2
3719
3711
| TRY_ADDREF op1_info, ah, r2
3720
3712
}
3721
3713
if (opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_POST_INC) {
@@ -3740,7 +3732,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3740
3732
zend_reg tmp_reg;
3741
3733
3742
3734
if (opline->opcode == ZEND_POST_INC || opline->opcode == ZEND_POST_DEC) {
3743
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, MAY_BE_DOUBLE, ZREG_R0, ZREG_R2, 0
3735
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, MAY_BE_DOUBLE, ZREG_R0, ZREG_R2
3744
3736
}
3745
3737
if (Z_MODE(op1_def_addr) == IS_REG) {
3746
3738
tmp_reg = Z_REG(op1_def_addr);
@@ -3766,7 +3758,7 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, const zend_
3766
3758
| SSE_SET_ZVAL_DVAL op1_def_addr, tmp_reg
3767
3759
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
3768
3760
opline->result_type != IS_UNUSED) {
3769
- | ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, op1_def_info, ZREG_R0, ZREG_R1, 0
3761
+ | ZVAL_COPY_VALUE res_addr, res_use_info, op1_addr, op1_def_info, ZREG_R0, ZREG_R1
3770
3762
| TRY_ADDREF op1_def_info, ah, r1
3771
3763
}
3772
3764
}
@@ -5207,7 +5199,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
5207
5199
| // ZVAL_COPY_VALUE(return_value, &ref->value);
5208
5200
ref_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R2, 8);
5209
5201
if (!res_addr) {
5210
- | ZVAL_COPY_VALUE var_addr, var_info, ref_addr, val_info, ZREG_R2, ZREG_R0, 0
5202
+ | ZVAL_COPY_VALUE var_addr, var_info, ref_addr, val_info, ZREG_R2, ZREG_R0
5211
5203
} else {
5212
5204
| ZVAL_COPY_VALUE_2 var_addr, var_info, res_addr, ref_addr, val_info, ZREG_R2, ZREG_R0
5213
5205
}
@@ -5236,7 +5228,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
5236
5228
}
5237
5229
5238
5230
if (!res_addr) {
5239
- | ZVAL_COPY_VALUE var_addr, var_info, val_addr, val_info, ZREG_R2, ZREG_R0, 0
5231
+ | ZVAL_COPY_VALUE var_addr, var_info, val_addr, val_info, ZREG_R2, ZREG_R0
5240
5232
} else {
5241
5233
| ZVAL_COPY_VALUE_2 var_addr, var_info, res_addr, val_addr, val_info, ZREG_R2, ZREG_R0
5242
5234
}
@@ -8901,7 +8893,7 @@ static int zend_jit_send_val(dasm_State **Dst, const zend_op *opline, const zend
8901
8893
| ADDREF_CONST zv, r0
8902
8894
}
8903
8895
} else {
8904
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2, 0
8896
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2
8905
8897
}
8906
8898
8907
8899
return 1;
@@ -8970,11 +8962,11 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, const zend
8970
8962
zend_jit_addr val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R1, 0);
8971
8963
8972
8964
| mov r1, aword T1 // restore
8973
- | ZVAL_COPY_VALUE ref_addr, MAY_BE_ANY, val_addr, op1_info, ZREG_R2, ZREG_R2, 0
8965
+ | ZVAL_COPY_VALUE ref_addr, MAY_BE_ANY, val_addr, op1_info, ZREG_R2, ZREG_R2
8974
8966
| SET_ZVAL_PTR val_addr, r0
8975
8967
| SET_ZVAL_TYPE_INFO val_addr, IS_REFERENCE_EX
8976
8968
} else {
8977
- | ZVAL_COPY_VALUE ref_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2, 0
8969
+ | ZVAL_COPY_VALUE ref_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2
8978
8970
| SET_ZVAL_PTR op1_addr, r0
8979
8971
| SET_ZVAL_TYPE_INFO op1_addr, IS_REFERENCE_EX
8980
8972
}
@@ -9038,7 +9030,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9038
9030
&& JIT_G(current_frame)->call->func) {
9039
9031
if (ARG_SHOULD_BE_SENT_BY_REF(JIT_G(current_frame)->call->func, arg_num)) {
9040
9032
9041
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2, 0
9033
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2
9042
9034
9043
9035
if (!ARG_MAY_BE_SENT_BY_REF(JIT_G(current_frame)->call->func, arg_num)) {
9044
9036
if (!(op1_info & MAY_BE_REF)) {
@@ -9067,7 +9059,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9067
9059
9068
9060
mask = ZEND_SEND_PREFER_REF << ((arg_num + 3) * 2);
9069
9061
9070
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2, 0
9062
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2
9071
9063
if (op1_info & MAY_BE_REF) {
9072
9064
| cmp cl, IS_REFERENCE
9073
9065
| je >7
@@ -9139,7 +9131,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9139
9131
}
9140
9132
9141
9133
if (opline->opcode == ZEND_SEND_VAR_NO_REF) {
9142
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2, 0
9134
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R1, ZREG_R2
9143
9135
if (op1_info & MAY_BE_REF) {
9144
9136
| cmp cl, IS_REFERENCE
9145
9137
| je >7
@@ -9166,7 +9158,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9166
9158
9167
9159
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
9168
9160
| ZVAL_DEREF FCARG1a, op1_info
9169
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, val_addr, op1_info, ZREG_R0, ZREG_R2, 0
9161
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, val_addr, op1_info, ZREG_R0, ZREG_R2
9170
9162
| TRY_ADDREF op1_info, ah, r2
9171
9163
} else {
9172
9164
zend_jit_addr ref_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 8);
@@ -9177,7 +9169,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9177
9169
| // zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
9178
9170
| GET_ZVAL_PTR FCARG1a, op1_addr
9179
9171
| // ZVAL_COPY_VALUE(return_value, &ref->value);
9180
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, ref_addr, op1_info, ZREG_R0, ZREG_R2, 0
9172
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, ref_addr, op1_info, ZREG_R0, ZREG_R2
9181
9173
| GC_DELREF FCARG1a
9182
9174
| je >1
9183
9175
| IF_NOT_REFCOUNTED ah, >2
@@ -9187,7 +9179,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9187
9179
| EFREE_REG_24 op_array, opline
9188
9180
| jmp >2
9189
9181
|.code
9190
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2, 0
9182
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2
9191
9183
|2:
9192
9184
}
9193
9185
} else {
@@ -9199,7 +9191,7 @@ static int zend_jit_send_var(dasm_State **Dst, const zend_op *opline, const zend
9199
9191
op1_addr= op1_def_addr;
9200
9192
}
9201
9193
}
9202
- | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2, 0
9194
+ | ZVAL_COPY_VALUE arg_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2
9203
9195
if (opline->op1_type == IS_CV) {
9204
9196
| TRY_ADDREF op1_info, ah, r2
9205
9197
}
@@ -9972,14 +9964,14 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
9972
9964
| ADDREF_CONST zv, r0
9973
9965
}
9974
9966
} else if (opline->op1_type == IS_TMP_VAR) {
9975
- | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2, 0
9967
+ | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2
9976
9968
} else if (opline->op1_type == IS_CV) {
9977
9969
if (op1_info & MAY_BE_REF) {
9978
9970
| LOAD_ZVAL_ADDR r0, op1_addr
9979
9971
| ZVAL_DEREF r0, op1_info
9980
9972
op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 0);
9981
9973
}
9982
- | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2, 0
9974
+ | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2
9983
9975
if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE || (op1_info & MAY_BE_REF) || (return_value_used != 1)) {
9984
9976
| // TODO: JIT: if (EXPECTED(!(EX_CALL_INFO() & ZEND_CALL_CODE))) ZVAL_NULL(retval_ptr); ???
9985
9977
| TRY_ADDREF op1_info, ah, r2
@@ -9994,7 +9986,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
9994
9986
| // zend_refcounted *ref = Z_COUNTED_P(retval_ptr);
9995
9987
| GET_ZVAL_PTR r0, op1_addr
9996
9988
| // ZVAL_COPY_VALUE(return_value, &ref->value);
9997
- | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, ref_addr, op1_info, ZREG_R2, ZREG_R2, 0
9989
+ | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, ref_addr, op1_info, ZREG_R2, ZREG_R2
9998
9990
| GC_DELREF r0
9999
9991
| je >2
10000
9992
| // if (IS_REFCOUNTED())
@@ -10020,7 +10012,7 @@ static int zend_jit_return(dasm_State **Dst, const zend_op *opline, const zend_o
10020
10012
}
10021
10013
|.code
10022
10014
}
10023
- | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2, 0
10015
+ | ZVAL_COPY_VALUE ret_addr, MAY_BE_ANY, op1_addr, op1_info, ZREG_R0, ZREG_R2
10024
10016
}
10025
10017
10026
10018
|9:
@@ -10236,7 +10228,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, cons
10236
10228
}
10237
10229
} else {
10238
10230
| // ZVAL_COPY
10239
- | ZVAL_COPY_VALUE res_addr, -1, val_addr, MAY_BE_ANY, ZREG_R1, ZREG_R2, 0
10231
+ | ZVAL_COPY_VALUE res_addr, -1, val_addr, MAY_BE_ANY, ZREG_R1, ZREG_R2
10240
10232
| TRY_ADDREF res_info, ch, r2
10241
10233
}
10242
10234
}
0 commit comments