|
65 | 65 | #undef ir_CONST_ADDR |
66 | 66 | #define ir_CONST_ADDR(_addr) jit_CONST_ADDR(jit, (uintptr_t)(_addr)) |
67 | 67 | #define ir_CONST_FUNC(_addr) jit_CONST_FUNC(jit, (uintptr_t)(_addr), 0) |
68 | | -#define ir_CONST_FC_FUNC(_addr) jit_CONST_FUNC(jit, (uintptr_t)(_addr), IR_CONST_FASTCALL_FUNC) |
69 | | -#define ir_CAST_FC_FUNC(_addr) ir_fold2(_ir_CTX, IR_OPT(IR_BITCAST, IR_ADDR), (_addr), IR_CONST_FASTCALL_FUNC) |
| 68 | +#define ir_CONST_FC_FUNC(_addr) jit_CONST_FUNC(jit, (uintptr_t)(_addr), IR_FASTCALL_FUNC) |
| 69 | +#define ir_CAST_FC_FUNC(_addr) ir_fold2(_ir_CTX, IR_OPT(IR_PROTO, IR_ADDR), (_addr), \ |
| 70 | + ir_proto_0(_ir_CTX, IR_FASTCALL_FUNC, IR_I32)) |
70 | 71 |
|
71 | 72 | #undef ir_ADD_OFFSET |
72 | 73 | #define ir_ADD_OFFSET(_addr, _offset) \ |
@@ -492,17 +493,23 @@ static ir_ref jit_CONST_FUNC(zend_jit_ctx *jit, uintptr_t addr, uint16_t flags) |
492 | 493 | ir_ref ref; |
493 | 494 | ir_insn *insn; |
494 | 495 | zval *zv; |
| 496 | +#if defined(IR_TARGET_X86) |
| 497 | + /* TODO: dummy prototype (only flags matter) ??? */ |
| 498 | + ir_ref proto = flags ? ir_proto_0(&jit->ctx, flags, IR_I32) : 0; |
| 499 | +#else |
| 500 | + ir_ref proto = 0; |
| 501 | +#endif |
495 | 502 |
|
496 | 503 | ZEND_ASSERT(addr != 0); |
497 | 504 | zv = zend_hash_index_lookup(&jit->addr_hash, addr); |
498 | 505 | if (Z_TYPE_P(zv) == IS_LONG) { |
499 | 506 | ref = Z_LVAL_P(zv); |
500 | | - ZEND_ASSERT(jit->ctx.ir_base[ref].opt == IR_OPT(IR_FUNC_ADDR, IR_ADDR) && jit->ctx.ir_base[ref].const_flags == flags); |
| 507 | + ZEND_ASSERT(jit->ctx.ir_base[ref].opt == IR_OPT(IR_FUNC_ADDR, IR_ADDR) && jit->ctx.ir_base[ref].proto == proto); |
501 | 508 | } else { |
502 | 509 | ref = ir_unique_const_addr(&jit->ctx, addr); |
503 | 510 | insn = &jit->ctx.ir_base[ref]; |
504 | 511 | insn->optx = IR_OPT(IR_FUNC_ADDR, IR_ADDR); |
505 | | - insn->const_flags = flags; |
| 512 | + insn->proto = proto; |
506 | 513 | ZVAL_LONG(zv, ref); |
507 | 514 | } |
508 | 515 | return ref; |
@@ -551,7 +558,12 @@ static ir_ref jit_STUB_FUNC_ADDR(zend_jit_ctx *jit, jit_stub_id id, uint16_t fla |
551 | 558 | ref = ir_unique_const_addr(&jit->ctx, (uintptr_t)zend_jit_stub_handlers[id]); |
552 | 559 | insn = &jit->ctx.ir_base[ref]; |
553 | 560 | insn->optx = IR_OPT(IR_FUNC_ADDR, IR_ADDR); |
554 | | - insn->const_flags = flags; |
| 561 | +#if defined(IR_TARGET_X86) |
| 562 | + /* TODO: dummy prototype (only flags matter) ??? */ |
| 563 | + insn->proto = flags ? ir_proto_0(&jit->ctx, flags, IR_I32) : 0; |
| 564 | +#else |
| 565 | + insn->proto = 0; |
| 566 | +#endif |
555 | 567 | jit->stub_addr[id] = ref; |
556 | 568 | } |
557 | 569 | return ref; |
@@ -6046,7 +6058,7 @@ static int zend_jit_assign_to_variable_call(zend_jit_ctx *jit, |
6046 | 6058 | jit_SET_EX_OPLINE(jit, opline); |
6047 | 6059 | ir_CALL_1(IR_VOID, ir_CONST_FC_FUNC(zend_jit_undefined_op_helper), ir_CONST_U32(Z_OFFSET(val_addr))); |
6048 | 6060 |
|
6049 | | - ir_CALL_2(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_assign_const, IR_CONST_FASTCALL_FUNC), |
| 6061 | + ir_CALL_2(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_assign_const, IR_FASTCALL_FUNC), |
6050 | 6062 | jit_ZVAL_ADDR(jit, var_addr), |
6051 | 6063 | jit_EG(uninitialized_zval)); |
6052 | 6064 |
|
@@ -6081,7 +6093,7 @@ static int zend_jit_assign_to_variable_call(zend_jit_ctx *jit, |
6081 | 6093 | jit_SET_EX_OPLINE(jit, opline); |
6082 | 6094 | } |
6083 | 6095 |
|
6084 | | - ir_CALL_2(IR_VOID, jit_STUB_FUNC_ADDR(jit, func, IR_CONST_FASTCALL_FUNC), |
| 6096 | + ir_CALL_2(IR_VOID, jit_STUB_FUNC_ADDR(jit, func, IR_FASTCALL_FUNC), |
6085 | 6097 | jit_ZVAL_ADDR(jit, var_addr), |
6086 | 6098 | jit_ZVAL_ADDR(jit, val_addr)); |
6087 | 6099 |
|
@@ -11543,7 +11555,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, |
11543 | 11555 | // JIT: zend_error(E_WARNING,"Undefined array key " ZEND_LONG_FMT, hval); |
11544 | 11556 | // JIT: retval = &EG(uninitialized_zval); |
11545 | 11557 | jit_SET_EX_OPLINE(jit, opline); |
11546 | | - ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_undefined_offset, IR_CONST_FASTCALL_FUNC)); |
| 11558 | + ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_undefined_offset, IR_FASTCALL_FUNC)); |
11547 | 11559 | ir_END_list(*end_inputs); |
11548 | 11560 | break; |
11549 | 11561 | case BP_VAR_IS: |
@@ -11723,7 +11735,7 @@ static int zend_jit_fetch_dimension_address_inner(zend_jit_ctx *jit, |
11723 | 11735 | ir_IF_FALSE_cold(if_found); |
11724 | 11736 | // JIT: zend_error(E_WARNING, "Undefined array key \"%s\"", ZSTR_VAL(offset_key)); |
11725 | 11737 | jit_SET_EX_OPLINE(jit, opline); |
11726 | | - ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_undefined_key, IR_CONST_FASTCALL_FUNC)); |
| 11738 | + ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_undefined_key, IR_FASTCALL_FUNC)); |
11727 | 11739 | ir_END_list(*end_inputs); |
11728 | 11740 | break; |
11729 | 11741 | case BP_VAR_IS: |
@@ -12314,7 +12326,7 @@ static zend_jit_addr zend_jit_prepare_array_update(zend_jit_ctx *jit, |
12314 | 12326 | } |
12315 | 12327 | // JIT: ZVAL_ARR(container, zend_new_array(8)); |
12316 | 12328 | ref = ir_CALL_1(IR_ADDR, |
12317 | | - jit_STUB_FUNC_ADDR(jit, jit_stub_new_array, IR_CONST_FASTCALL_FUNC), |
| 12329 | + jit_STUB_FUNC_ADDR(jit, jit_stub_new_array, IR_FASTCALL_FUNC), |
12318 | 12330 | jit_ZVAL_ADDR(jit, op1_addr)); |
12319 | 12331 | if (array_inputs->count) { |
12320 | 12332 | ir_refs_add(array_inputs, ir_END()); |
@@ -12372,7 +12384,7 @@ static int zend_jit_fetch_dim(zend_jit_ctx *jit, |
12372 | 12384 | if (opline->opcode != ZEND_FETCH_DIM_RW) { |
12373 | 12385 | jit_SET_EX_OPLINE(jit, opline); |
12374 | 12386 | } |
12375 | | - ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_cannot_add_element, IR_CONST_FASTCALL_FUNC)); |
| 12387 | + ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_cannot_add_element, IR_FASTCALL_FUNC)); |
12376 | 12388 | ir_END_list(end_inputs); |
12377 | 12389 |
|
12378 | 12390 | ir_IF_TRUE(if_ok); |
@@ -12744,7 +12756,7 @@ static int zend_jit_assign_dim(zend_jit_ctx *jit, const zend_op *opline, uint32_ |
12744 | 12756 |
|
12745 | 12757 | // JIT: zend_throw_error(NULL, "Cannot add element to the array as the next element is already occupied"); |
12746 | 12758 | jit_SET_EX_OPLINE(jit, opline); |
12747 | | - ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_cannot_add_element, IR_CONST_FASTCALL_FUNC)); |
| 12759 | + ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_cannot_add_element, IR_FASTCALL_FUNC)); |
12748 | 12760 |
|
12749 | 12761 | ir_END_list(end_inputs); |
12750 | 12762 |
|
@@ -12889,7 +12901,7 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit, const zend_op *opline, uint |
12889 | 12901 | ir_IF_FALSE_cold(if_ok); |
12890 | 12902 |
|
12891 | 12903 | // JIT: zend_throw_error(NULL, "Cannot add element to the array as the next element is already occupied"); |
12892 | | - ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_cannot_add_element, IR_CONST_FASTCALL_FUNC)); |
| 12904 | + ir_CALL(IR_VOID, jit_STUB_FUNC_ADDR(jit, jit_stub_cannot_add_element, IR_FASTCALL_FUNC)); |
12893 | 12905 |
|
12894 | 12906 | ir_END_list(end_inputs); |
12895 | 12907 |
|
|
0 commit comments