Skip to content

Commit f024119

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Tracing JIT: Fixed possible incorrect megamorphic call from a trait
2 parents c37b35f + c7c7620 commit f024119

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8988,6 +8988,12 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
89888988
if (call_info && call_info->callee_func && !call_info->is_prototype) {
89898989
func = call_info->callee_func;
89908990
}
8991+
if ((op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)
8992+
&& JIT_G(current_frame)
8993+
&& JIT_G(current_frame)->call
8994+
&& !JIT_G(current_frame)->call->func) {
8995+
call_info = NULL; func = NULL; /* megamorphic call from trait */
8996+
}
89918997
}
89928998
if (!func) {
89938999
/* resolve function at run time */

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9630,6 +9630,12 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend
96309630
if (call_info && call_info->callee_func && !call_info->is_prototype) {
96319631
func = call_info->callee_func;
96329632
}
9633+
if ((op_array->fn_flags & ZEND_ACC_TRAIT_CLONE)
9634+
&& JIT_G(current_frame)
9635+
&& JIT_G(current_frame)->call
9636+
&& !JIT_G(current_frame)->call->func) {
9637+
call_info = NULL; func = NULL; /* megamorphic call from trait */
9638+
}
96339639
}
96349640
if (!func) {
96359641
/* resolve function at run time */

0 commit comments

Comments
 (0)