Skip to content

Commit bb64585

Browse files
committed
Skip named params in jit
Still incomplete
1 parent ccf5c89 commit bb64585

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,10 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
24682468
goto done;
24692469
case ZEND_SEND_VAL:
24702470
case ZEND_SEND_VAL_EX:
2471+
if (opline->op2_type == IS_CONST) {
2472+
/* Named parameters not supported in JIT */
2473+
break;
2474+
}
24712475
if (opline->opcode == ZEND_SEND_VAL_EX
24722476
&& opline->op2.num > MAX_ARG_FLAG_NUM) {
24732477
break;
@@ -2478,6 +2482,10 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
24782482
}
24792483
goto done;
24802484
case ZEND_SEND_REF:
2485+
if (opline->op2_type == IS_CONST) {
2486+
/* Named parameters not supported in JIT */
2487+
break;
2488+
}
24812489
if (!zend_jit_send_ref(&dasm_state, opline, op_array,
24822490
OP1_INFO(), 0)) {
24832491
goto jit_failure;
@@ -2488,6 +2496,10 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
24882496
case ZEND_SEND_VAR_NO_REF:
24892497
case ZEND_SEND_VAR_NO_REF_EX:
24902498
case ZEND_SEND_FUNC_ARG:
2499+
if (opline->op2_type == IS_CONST) {
2500+
/* Named parameters not supported in JIT */
2501+
break;
2502+
}
24912503
if ((opline->opcode == ZEND_SEND_VAR_EX
24922504
|| opline->opcode == ZEND_SEND_VAR_NO_REF_EX)
24932505
&& opline->op2.num > MAX_ARG_FLAG_NUM) {
@@ -2507,6 +2519,10 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
25072519
}
25082520
goto done;
25092521
case ZEND_CHECK_FUNC_ARG:
2522+
if (opline->op2_type == IS_CONST) {
2523+
/* Named parameters not supported in JIT */
2524+
break;
2525+
}
25102526
if (opline->op2.num > MAX_ARG_FLAG_NUM) {
25112527
break;
25122528
}

ext/opcache/jit/zend_jit_trace.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3354,6 +3354,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
33543354
goto done;
33553355
case ZEND_SEND_VAL:
33563356
case ZEND_SEND_VAL_EX:
3357+
if (opline->op2_type == IS_CONST) {
3358+
/* Named parameters not supported in JIT */
3359+
break;
3360+
}
33573361
if (opline->opcode == ZEND_SEND_VAL_EX
33583362
&& opline->op2.num > MAX_ARG_FLAG_NUM) {
33593363
break;
@@ -3378,6 +3382,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
33783382
}
33793383
goto done;
33803384
case ZEND_SEND_REF:
3385+
if (opline->op2_type == IS_CONST) {
3386+
/* Named parameters not supported in JIT */
3387+
break;
3388+
}
33813389
op1_info = OP1_INFO();
33823390
USE_OP1_TRACE_TYPE();
33833391
if (!zend_jit_send_ref(&dasm_state, opline, op_array,
@@ -3390,6 +3398,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
33903398
case ZEND_SEND_VAR_NO_REF:
33913399
case ZEND_SEND_VAR_NO_REF_EX:
33923400
case ZEND_SEND_FUNC_ARG:
3401+
if (opline->op2_type == IS_CONST) {
3402+
/* Named parameters not supported in JIT */
3403+
break;
3404+
}
33933405
if ((opline->opcode == ZEND_SEND_VAR_EX
33943406
|| opline->opcode == ZEND_SEND_VAR_NO_REF_EX)
33953407
&& opline->op2.num > MAX_ARG_FLAG_NUM) {
@@ -3426,6 +3438,10 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
34263438
}
34273439
goto done;
34283440
case ZEND_CHECK_FUNC_ARG:
3441+
if (opline->op2_type == IS_CONST) {
3442+
/* Named parameters not supported in JIT */
3443+
break;
3444+
}
34293445
if (opline->op2.num > MAX_ARG_FLAG_NUM
34303446
&& (!JIT_G(current_frame)
34313447
|| !JIT_G(current_frame)->call

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_leave_nested_func_helper(uint32_t
5757
} else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
5858
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
5959
}
60+
if (UNEXPECTED(call_info & ZEND_CALL_HAS_EXTRA_NAMED_PARAMS)) {
61+
zend_array_destroy(EX(extra_named_params));
62+
}
6063

6164
old_execute_data = execute_data;
6265
execute_data = EX(prev_execute_data);

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8375,6 +8375,9 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
83758375
unknown_num_args = 1;
83768376
}
83778377

8378+
/* TODO: Only do this for named args */
8379+
unknown_num_args = 1;
8380+
83788381
if (info) {
83798382
call_info = info->callee_info;
83808383
while (call_info && call_info->caller_call_opline != opline) {
@@ -9814,7 +9817,7 @@ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, const ze
98149817
{
98159818
/* ZEND_CALL_FAKE_CLOSURE handled on slow path to eliminate check for ZEND_CALL_CLOSURE on fast path */
98169819
| mov FCARG1d, dword [FP + offsetof(zend_execute_data, This.u1.type_info)]
9817-
| test FCARG1d, (ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED|ZEND_CALL_FAKE_CLOSURE)
9820+
| test FCARG1d, (ZEND_CALL_TOP|ZEND_CALL_HAS_SYMBOL_TABLE|ZEND_CALL_FREE_EXTRA_ARGS|ZEND_CALL_ALLOCATED|ZEND_CALL_HAS_EXTRA_NAMED_PARAMS|ZEND_CALL_FAKE_CLOSURE)
98189821
if (trace && trace->op != ZEND_JIT_TRACE_END) {
98199822
| jnz >1
98209823
|.cold_code

0 commit comments

Comments
 (0)