Skip to content

Commit c8920aa

Browse files
authored
JIT: JIT: Implement CPU register usage for ISSET_ISEMPTY_DIM (#14227)
1 parent 64f4aca commit c8920aa

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
22702270
}
22712271
if (!zend_jit_isset_isempty_dim(&ctx, opline,
22722272
OP1_INFO(), OP1_REG_ADDR(), 0,
2273-
OP2_INFO(), IS_UNKNOWN,
2273+
OP2_INFO(), OP2_REG_ADDR(), IS_UNKNOWN,
22742274
zend_may_throw(opline, ssa_op, op_array, ssa),
22752275
smart_branch_opcode, target_label, target_label2,
22762276
NULL)) {

ext/opcache/jit/zend_jit_ir.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12604,14 +12604,15 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
1260412604
zend_jit_addr op1_addr,
1260512605
bool op1_avoid_refcounting,
1260612606
uint32_t op2_info,
12607+
zend_jit_addr op2_addr,
1260712608
uint8_t dim_type,
1260812609
int may_throw,
1260912610
uint8_t smart_branch_opcode,
1261012611
uint32_t target_label,
1261112612
uint32_t target_label2,
1261212613
const void *exit_addr)
1261312614
{
12614-
zend_jit_addr op2_addr, res_addr;
12615+
zend_jit_addr res_addr;
1261512616
ir_ref if_type = IR_UNUSED;
1261612617
ir_ref false_inputs = IR_UNUSED, end_inputs = IR_UNUSED;
1261712618
ir_refs *true_inputs;
@@ -12621,7 +12622,6 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
1262112622
// TODO: support for empty() ???
1262212623
ZEND_ASSERT(!(opline->extended_value & ZEND_ISEMPTY));
1262312624

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

1262712627
if (op1_info & MAY_BE_REF) {
@@ -12654,7 +12654,7 @@ static int zend_jit_isset_isempty_dim(zend_jit_ctx *jit,
1265412654
}
1265512655
}
1265612656
if (!zend_jit_fetch_dimension_address_inner(jit, opline, BP_JIT_IS, op1_info,
12657-
op2_info, OP2_ADDR(), dim_type, found_exit_addr, not_found_exit_addr, NULL,
12657+
op2_info, op2_addr, dim_type, found_exit_addr, not_found_exit_addr, NULL,
1265812658
0, ht_ref, true_inputs, NULL, &false_inputs, NULL)) {
1265912659
return 0;
1266012660
}
@@ -16556,6 +16556,11 @@ static bool zend_jit_opline_supports_reg(const zend_op_array *op_array, zend_ssa
1655616556
return 1;
1655716557
case ZEND_FETCH_CONSTANT:
1655816558
return 1;
16559+
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
16560+
if ((opline->extended_value & ZEND_ISEMPTY)) {
16561+
return 0;
16562+
}
16563+
ZEND_FALLTHROUGH;
1655916564
case ZEND_FETCH_DIM_R:
1656016565
case ZEND_FETCH_DIM_IS:
1656116566
case ZEND_FETCH_LIST_R:

ext/opcache/jit/zend_jit_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5849,7 +5849,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
58495849
}
58505850
if (!zend_jit_isset_isempty_dim(&ctx, opline,
58515851
op1_info, op1_addr, avoid_refcounting,
5852-
op2_info, val_type,
5852+
op2_info, OP2_REG_ADDR(), val_type,
58535853
zend_may_throw_ex(opline, ssa_op, op_array, ssa, op1_info, op2_info),
58545854
smart_branch_opcode, -1, -1,
58555855
exit_addr)) {

0 commit comments

Comments
 (0)