Skip to content

Commit 5c83f33

Browse files
committed
jit
1 parent 564d7ba commit 5c83f33

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,8 +2584,10 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
25842584
}
25852585
goto done;
25862586
case ZEND_CHECK_NAMED:
2587-
/* TODO: Trivial to support! */
2588-
break;
2587+
if (!zend_jit_check_named(&dasm_state, opline)) {
2588+
goto jit_failure;
2589+
}
2590+
goto done;
25892591
case ZEND_DO_UCALL:
25902592
is_terminated = 1;
25912593
/* break missing intentionally */

ext/opcache/jit/zend_jit_trace.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,9 +1576,6 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
15761576
}
15771577
}
15781578
break;
1579-
case ZEND_CHECK_NAMED:
1580-
/* TODO: Trivial to support! */
1581-
break;
15821579
case ZEND_FETCH_OBJ_FUNC_ARG:
15831580
if (!frame
15841581
|| !frame->call
@@ -3638,6 +3635,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
36383635
goto jit_failure;
36393636
}
36403637
goto done;
3638+
case ZEND_CHECK_NAMED:
3639+
if (!zend_jit_check_named(&dasm_state, opline)) {
3640+
goto jit_failure;
3641+
}
3642+
goto done;
36413643
case ZEND_DO_UCALL:
36423644
case ZEND_DO_ICALL:
36433645
case ZEND_DO_FCALL_BY_NAME:

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9200,6 +9200,24 @@ static int zend_jit_send_val(dasm_State **Dst, const zend_op *opline, const zend
92009200
return 1;
92019201
}
92029202

9203+
static int zend_jit_check_named(dasm_State **Dst, const zend_op *opline)
9204+
{
9205+
| mov FCARG1a, EX->call
9206+
| test byte [FCARG1a + offsetof(zend_execute_data, This.u1.type_info) + 3], (ZEND_CALL_MAY_HAVE_UNDEF >> 24)
9207+
| jnz >1
9208+
|.cold_code
9209+
|1:
9210+
| SAVE_VALID_OPLINE opline, r0
9211+
| EXT_CALL zend_handle_undef_args, r0
9212+
| test r0, r0
9213+
| jnz ->exception_handler
9214+
| jmp >2
9215+
|.code
9216+
|2:
9217+
9218+
return 1;
9219+
}
9220+
92039221
static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, uint32_t op1_info, int cold)
92049222
{
92059223
zend_jit_addr op1_addr, arg_addr, ref_addr;

0 commit comments

Comments
 (0)