Skip to content

JIT: JIT: Implement CPU register usage for ISSET_ISEMPTY_DIM #14227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2270,7 +2270,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
}
if (!zend_jit_isset_isempty_dim(&ctx, opline,
OP1_INFO(), OP1_REG_ADDR(), 0,
OP2_INFO(), IS_UNKNOWN,
OP2_INFO(), OP2_REG_ADDR(), IS_UNKNOWN,
zend_may_throw(opline, ssa_op, op_array, ssa),
smart_branch_opcode, target_label, target_label2,
NULL)) {
Expand Down
11 changes: 8 additions & 3 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -12604,14 +12604,15 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
zend_jit_addr op1_addr,
bool op1_avoid_refcounting,
uint32_t op2_info,
zend_jit_addr op2_addr,
uint8_t dim_type,
int may_throw,
uint8_t smart_branch_opcode,
uint32_t target_label,
uint32_t target_label2,
const void *exit_addr)
{
zend_jit_addr op2_addr, res_addr;
zend_jit_addr res_addr;
ir_ref if_type = IR_UNUSED;
ir_ref false_inputs = IR_UNUSED, end_inputs = IR_UNUSED;
ir_refs *true_inputs;
Expand All @@ -12621,7 +12622,6 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
// TODO: support for empty() ???
ZEND_ASSERT(!(opline->extended_value & ZEND_ISEMPTY));

op2_addr = OP2_ADDR();
res_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->result.var);

if (op1_info & MAY_BE_REF) {
Expand Down Expand Up @@ -12654,7 +12654,7 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
}
}
if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_JIT_IS, op1_info,
op2_info, OP2_ADDR(), dim_type, found_exit_addr, not_found_exit_addr, NULL,
op2_info, op2_addr, dim_type, found_exit_addr, not_found_exit_addr, NULL,
0, ht_ref, true_inputs, NULL, &false_inputs, NULL)) {
return 0;
}
Expand Down Expand Up @@ -16556,6 +16556,11 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa
return 1;
case ZEND_FETCH_CONSTANT:
return 1;
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
if ((opline->extended_value & ZEND_ISEMPTY)) {
return 0;
}
ZEND_FALLTHROUGH;
case ZEND_FETCH_DIM_R:
case ZEND_FETCH_DIM_IS:
case ZEND_FETCH_LIST_R:
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -5849,7 +5849,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
}
if (!zend_jit_isset_isempty_dim(&ctx, opline,
op1_info, op1_addr, avoid_refcounting,
op2_info, val_type,
op2_info, OP2_REG_ADDR(), val_type,
zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info),
smart_branch_opcode, -1, -1,
exit_addr)) {
Expand Down