Skip to content

Commit 5f31d15

Browse files
committed
jit cleanup
1 parent 17c2e40 commit 5f31d15

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8567,8 +8567,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
85678567
#endif
85688568
}
85698569

8570-
bool may_have_extra_named_params =
8571-
opline->extended_value == ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS;
85728570
if ((opline-1)->opcode == ZEND_SEND_UNPACK || (opline-1)->opcode == ZEND_SEND_ARRAY ||
85738571
(opline-1)->opcode == ZEND_CHECK_UNDEF_ARGS) {
85748572
unknown_num_args = 1;
@@ -8624,6 +8622,10 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
86248622
}
86258623
}
86268624

8625+
bool may_have_extra_named_params =
8626+
opline->extended_value == ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS &&
8627+
(!func || func->common.fn_flags & ZEND_ACC_VARIADIC);
8628+
86278629
if (!reuse_ip) {
86288630
zend_jit_start_reuse_ip();
86298631
| // call = EX(call);
@@ -8992,9 +8994,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
89928994
}
89938995
}
89948996

8995-
| // EG(current_execute_data) = execute_data;
8996-
| MEM_OP2_1_ZTS mov, aword, executor_globals, current_execute_data, RX, r1
8997-
89988997
if (!RETURN_VALUE_USED(opline)) {
89998998
|.if not(X64WIN)
90008999
| sub r4, 16 /* alloca() */
@@ -9005,6 +9004,9 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
90059004
| LOAD_ZVAL_ADDR FCARG2a, res_addr
90069005
| SET_Z_TYPE_INFO FCARG2a, IS_NULL
90079006

9007+
| // EG(current_execute_data) = execute_data;
9008+
| MEM_OP2_1_ZTS mov, aword, executor_globals, current_execute_data, RX, r1
9009+
90089010
zend_jit_reset_opline(Dst, NULL);
90099011

90109012
| // fbc->internal_function.handler(call, ret);
@@ -11036,17 +11038,17 @@ static int zend_jit_recv(dasm_State **Dst, const zend_op *opline, const zend_op_
1103611038
}
1103711039

1103811040
if (arg_info || (opline+1)->opcode != ZEND_RECV) {
11039-
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
11041+
| cmp dword EX->This.u2.num_args, arg_num
1104011042
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
1104111043
int32_t exit_point = zend_jit_trace_get_exit_point(opline, opline, NULL, ZEND_JIT_EXIT_TO_VM);
1104211044
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
1104311045

1104411046
if (!exit_addr) {
1104511047
return 0;
1104611048
}
11047-
| IF_ZVAL_TYPE res_addr, IS_UNDEF, &exit_addr
11049+
| jb &exit_addr
1104811050
} else {
11049-
| IF_ZVAL_TYPE res_addr, IS_UNDEF, >1
11051+
| jb >1
1105011052
|.cold_code
1105111053
|1:
1105211054
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
@@ -11085,7 +11087,11 @@ static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zen
1108511087
zval *zv = RT_CONSTANT(opline, opline->op2);
1108611088
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);
1108711089

11088-
| IF_NOT_ZVAL_TYPE res_addr, IS_UNDEF, >5
11090+
if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE ||
11091+
(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
11092+
| cmp dword EX->This.u2.num_args, arg_num
11093+
| jae >5
11094+
}
1108911095
| ZVAL_COPY_CONST res_addr, -1, -1, zv, r0
1109011096
if (Z_REFCOUNTED_P(zv)) {
1109111097
| ADDREF_CONST zv, r0

0 commit comments

Comments
 (0)