Skip to content

Commit

Permalink
jit cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 31, 2020
1 parent 17c2e40 commit 5f31d15
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions ext/opcache/jit/zend_jit_x86.dasc
Expand Up @@ -8567,8 +8567,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
#endif
}

bool may_have_extra_named_params =
opline->extended_value == ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS;
if ((opline-1)->opcode == ZEND_SEND_UNPACK || (opline-1)->opcode == ZEND_SEND_ARRAY ||
(opline-1)->opcode == ZEND_CHECK_UNDEF_ARGS) {
unknown_num_args = 1;
Expand Down Expand Up @@ -8624,6 +8622,10 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}
}

bool may_have_extra_named_params =
opline->extended_value == ZEND_FCALL_MAY_HAVE_EXTRA_NAMED_PARAMS &&
(!func || func->common.fn_flags & ZEND_ACC_VARIADIC);

if (!reuse_ip) {
zend_jit_start_reuse_ip();
| // call = EX(call);
Expand Down Expand Up @@ -8992,9 +8994,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
}
}

| // EG(current_execute_data) = execute_data;
| MEM_OP2_1_ZTS mov, aword, executor_globals, current_execute_data, RX, r1

if (!RETURN_VALUE_USED(opline)) {
|.if not(X64WIN)
| sub r4, 16 /* alloca() */
Expand All @@ -9005,6 +9004,9 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
| LOAD_ZVAL_ADDR FCARG2a, res_addr
| SET_Z_TYPE_INFO FCARG2a, IS_NULL

| // EG(current_execute_data) = execute_data;
| MEM_OP2_1_ZTS mov, aword, executor_globals, current_execute_data, RX, r1

zend_jit_reset_opline(Dst, NULL);

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

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

if (!exit_addr) {
return 0;
}
| IF_ZVAL_TYPE res_addr, IS_UNDEF, &exit_addr
| jb &exit_addr
} else {
| IF_ZVAL_TYPE res_addr, IS_UNDEF, >1
| jb >1
|.cold_code
|1:
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
Expand Down Expand Up @@ -11085,7 +11087,11 @@ static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zen
zval *zv = RT_CONSTANT(opline, opline->op2);
zend_jit_addr res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);

| IF_NOT_ZVAL_TYPE res_addr, IS_UNDEF, >5
if (JIT_G(trigger) != ZEND_JIT_ON_HOT_TRACE ||
(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
| cmp dword EX->This.u2.num_args, arg_num
| jae >5
}
| ZVAL_COPY_CONST res_addr, -1, -1, zv, r0
if (Z_REFCOUNTED_P(zv)) {
| ADDREF_CONST zv, r0
Expand Down

0 comments on commit 5f31d15

Please sign in to comment.