Skip to content

Commit

Permalink
Fix JIT
Browse files Browse the repository at this point in the history
  • Loading branch information
iluuu1994 committed Nov 8, 2023
1 parent a7df3da commit 547efec
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -16646,24 +16646,19 @@ static bool zend_jit_may_be_in_reg(const zend_op_array *op_array, zend_ssa *ssa,

static void jit_frameless_icall0(zend_jit_ctx *jit, const zend_op *opline)
{
if (GCC_GLOBAL_REGS) {
// EX(opline) = opline
ir_STORE(jit_EX(opline), jit_IP(jit));
}
jit_SET_EX_OPLINE(jit, opline);

void *function = zend_flf_handlers[opline->extended_value];
zend_jit_addr res_addr = RES_ADDR();
ir_ref res_ref = jit_ZVAL_ADDR(jit, res_addr);
jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL);
ir_CALL_1(IR_VOID, ir_CONST_ADDR((size_t)function), res_ref);
zend_jit_check_exception(jit);
}

static void jit_frameless_icall1(zend_jit_ctx *jit, const zend_op *opline, uint32_t op1_info)
{
if (GCC_GLOBAL_REGS) {
// EX(opline) = opline
ir_STORE(jit_EX(opline), jit_IP(jit));
}
jit_SET_EX_OPLINE(jit, opline);

void *function = zend_flf_handlers[opline->extended_value];
zend_jit_addr res_addr = RES_ADDR();
Expand All @@ -16672,17 +16667,15 @@ static void jit_frameless_icall1(zend_jit_ctx *jit, const zend_op *opline, uint3
ir_ref op1_ref = jit_ZVAL_ADDR(jit, op1_addr);
zend_jit_zval_check_undef(jit, op1_ref, opline->op1.var, opline, 1);
op1_ref = jit_ZVAL_DEREF_ref(jit, op1_ref);
jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL);
ir_CALL_2(IR_VOID, ir_CONST_ADDR((size_t)function), res_ref, op1_ref);
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, NULL);
zend_jit_check_exception(jit);
}

static void jit_frameless_icall2(zend_jit_ctx *jit, const zend_op *opline, uint32_t op1_info, uint32_t op2_info)
{
if (GCC_GLOBAL_REGS) {
// EX(opline) = opline
ir_STORE(jit_EX(opline), jit_IP(jit));
}
jit_SET_EX_OPLINE(jit, opline);

void *function = zend_flf_handlers[opline->extended_value];
zend_jit_addr res_addr = RES_ADDR();
Expand All @@ -16695,6 +16688,7 @@ static void jit_frameless_icall2(zend_jit_ctx *jit, const zend_op *opline, uint3
zend_jit_zval_check_undef(jit, op2_ref, opline->op2.var, opline, 1);
op1_ref = jit_ZVAL_DEREF_ref(jit, op1_ref);
op2_ref = jit_ZVAL_DEREF_ref(jit, op2_ref);
jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL);
ir_CALL_3(IR_VOID, ir_CONST_ADDR((size_t)function), res_ref, op1_ref, op2_ref);
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, NULL);
jit_FREE_OP(jit, opline->op2_type, opline->op2, op2_info, NULL);
Expand All @@ -16703,10 +16697,7 @@ static void jit_frameless_icall2(zend_jit_ctx *jit, const zend_op *opline, uint3

static void jit_frameless_icall3(zend_jit_ctx *jit, const zend_op *opline, uint32_t op1_info, uint32_t op2_info, uint32_t op1_data_info)
{
if (GCC_GLOBAL_REGS) {
// EX(opline) = opline
ir_STORE(jit_EX(opline), jit_IP(jit));
}
jit_SET_EX_OPLINE(jit, opline);

void *function = zend_flf_handlers[opline->extended_value];
zend_jit_addr res_addr = RES_ADDR();
Expand All @@ -16723,6 +16714,7 @@ static void jit_frameless_icall3(zend_jit_ctx *jit, const zend_op *opline, uint3
op1_ref = jit_ZVAL_DEREF_ref(jit, op1_ref);
op2_ref = jit_ZVAL_DEREF_ref(jit, op2_ref);
op3_ref = jit_ZVAL_DEREF_ref(jit, op3_ref);
jit_set_Z_TYPE_INFO(jit, res_addr, IS_NULL);
ir_CALL_4(IR_VOID, ir_CONST_ADDR((size_t)function), res_ref, op1_ref, op2_ref, op3_ref);
jit_FREE_OP(jit, opline->op1_type, opline->op1, op1_info, NULL);
jit_FREE_OP(jit, opline->op2_type, opline->op2, op2_info, NULL);
Expand Down

0 comments on commit 547efec

Please sign in to comment.