Skip to content

Commit 9e8d894

Browse files
committed
FFI JIT for FETCH_DIM_RW + ASSIGN_DIM_OP
1 parent a3cdb7a commit 9e8d894

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
18171817
break;
18181818
}
18191819
if (!zend_jit_assign_dim_op(&ctx, opline,
1820-
OP1_INFO(), OP1_DEF_INFO(), OP1_REG_ADDR(),
1820+
OP1_INFO(), OP1_DEF_INFO(), OP1_REG_ADDR(), 0,
18211821
OP2_INFO(), (opline->op2_type != IS_UNUSED) ? OP2_REG_ADDR() : 0,
18221822
(opline->op2_type != IS_UNUSED) ? OP2_RANGE() : NULL,
18231823
OP1_DATA_INFO(), OP1_DATA_REG_ADDR(), OP1_DATA_RANGE(), IS_UNKNOWN,

ext/opcache/jit/zend_jit_ir.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14115,6 +14115,7 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit,
1411514115
uint32_t op1_info,
1411614116
uint32_t op1_def_info,
1411714117
zend_jit_addr op1_addr,
14118+
bool op1_indirect,
1411814119
uint32_t op2_info,
1411914120
zend_jit_addr op2_addr,
1412014121
zend_ssa_range *op2_range,
@@ -14313,6 +14314,9 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit,
1431314314

1431414315
jit_FREE_OP(jit, (opline+1)->op1_type, (opline+1)->op1, op1_data_info, NULL);
1431514316
jit_FREE_OP(jit, opline->op2_type, opline->op2, op2_info, NULL);
14317+
if (!op1_indirect) {
14318+
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, NULL);
14319+
}
1431614320
if (may_throw) {
1431714321
zend_jit_check_exception(jit);
1431814322
}
@@ -14510,6 +14514,7 @@ static int zend_jit_ffi_assign_dim_op(zend_jit_ctx *jit,
1451014514
uint32_t op1_info,
1451114515
uint32_t op1_def_info,
1451214516
zend_jit_addr op1_addr,
14517+
bool op1_indirect,
1451314518
uint32_t op2_info,
1451414519
zend_jit_addr op2_addr,
1451514520
zend_ssa_range *op2_range,
@@ -14545,6 +14550,10 @@ static int zend_jit_ffi_assign_dim_op(zend_jit_ctx *jit,
1454514550

1454614551
jit_FREE_OP(jit, (opline+1)->op1_type, (opline+1)->op1, op1_data_info, opline);
1454714552

14553+
if (!op1_indirect) {
14554+
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, opline);
14555+
}
14556+
1454814557
return 1;
1454914558
}
1455014559
#endif

ext/opcache/jit/zend_jit_trace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4688,15 +4688,15 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
46884688
}
46894689
op1_info = OP1_INFO();
46904690
op1_addr = OP1_REG_ADDR();
4691+
op1_indirect = 0;
46914692
if (opline->op1_type == IS_VAR) {
46924693
if (orig_op1_type != IS_UNKNOWN
46934694
&& (orig_op1_type & IS_TRACE_INDIRECT)) {
4695+
op1_indirect = 1;
46944696
if (!zend_jit_fetch_indirect_var(&ctx, opline, orig_op1_type,
46954697
&op1_info, &op1_addr, !ssa->var_info[ssa_op->op1_use].indirect_reference)) {
46964698
goto jit_failure;
46974699
}
4698-
} else {
4699-
break;
47004700
}
47014701
}
47024702
if (orig_op1_type != IS_UNKNOWN
@@ -4727,7 +4727,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
47274727
ffi_info = zend_arena_calloc(&CG(arena), ssa->vars_count, sizeof(zend_jit_ffi_info));
47284728
}
47294729
if (!zend_jit_ffi_assign_dim_op(&ctx, opline, ssa, ssa_op,
4730-
op1_info, op1_def_info, op1_addr,
4730+
op1_info, op1_def_info, op1_addr, op1_indirect,
47314731
op2_info, (opline->op2_type != IS_UNUSED) ? OP2_REG_ADDR() : 0,
47324732
(opline->op2_type != IS_UNUSED) ? OP2_RANGE() : NULL,
47334733
op1_data_info, OP1_DATA_REG_ADDR(), OP1_DATA_RANGE(),
@@ -4737,7 +4737,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
47374737
} else
47384738
#endif
47394739
if (!zend_jit_assign_dim_op(&ctx, opline,
4740-
op1_info, op1_def_info, op1_addr,
4740+
op1_info, op1_def_info, op1_addr, op1_indirect,
47414741
op2_info, (opline->op2_type != IS_UNUSED) ? OP2_REG_ADDR() : 0,
47424742
(opline->op2_type != IS_UNUSED) ? OP2_RANGE() : NULL,
47434743
op1_data_info, OP1_DATA_REG_ADDR(), OP1_DATA_RANGE(), val_type,

0 commit comments

Comments
 (0)