Skip to content

Commit b8472f7

Browse files
committed
Backport phpGH-17869 to PHP 8.3 JIT
1 parent a93ad36 commit b8472f7

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8655,11 +8655,18 @@ static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, con
86558655
| str TMP1w, EX:RX->This.u1.type_info
86568656
| // Z_PTR(call->This) = object_or_called_scope;
86578657
| str REG1, EX:RX->This.value.ptr
8658-
| ldr TMP1, [REG0, #offsetof(zend_closure, func.op_array.run_time_cache__ptr)]
8659-
| cbnz TMP1, >1
8660-
| add FCARG1x, REG0, #offsetof(zend_closure, func)
8661-
| EXT_CALL zend_jit_init_func_run_time_cache_helper, REG0
8662-
|1:
8658+
if (!func) {
8659+
| ldrb TMP1w, [REG0, #offsetof(zend_closure, func.type)]
8660+
| cmp TMP1w, #ZEND_USER_FUNCTION
8661+
| beq >1
8662+
}
8663+
if (!func || func->common.type == ZEND_USER_FUNCTION) {
8664+
| add FCARG1x, REG0, #offsetof(zend_closure, func)
8665+
| EXT_CALL zend_jit_init_func_run_time_cache_helper, REG0
8666+
}
8667+
if (!func) {
8668+
|1:
8669+
}
86638670
}
86648671
| // ZEND_CALL_NUM_ARGS(call) = num_args;
86658672
| LOAD_32BIT_VAL TMP1w, opline->extended_value

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9255,11 +9255,17 @@ static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, con
92559255
| or dword EX:RX->This.u1.type_info, edx
92569256
| // Z_PTR(call->This) = object_or_called_scope;
92579257
| mov aword EX:RX->This.value.ptr, r1
9258-
| cmp aword [r0 + offsetof(zend_closure, func.op_array.run_time_cache__ptr)], 0
9259-
| jnz >1
9260-
| lea FCARG1a, aword [r0 + offsetof(zend_closure, func)]
9261-
| EXT_CALL zend_jit_init_func_run_time_cache_helper, r0
9262-
|1:
9258+
if (!func) {
9259+
| cmp byte [r0 + offsetof(zend_closure, func.type)], ZEND_USER_FUNCTION
9260+
| jnz >1
9261+
}
9262+
if (!func || func->common.type == ZEND_USER_FUNCTION) {
9263+
| lea FCARG1a, aword [r0 + offsetof(zend_closure, func)]
9264+
| EXT_CALL zend_jit_init_func_run_time_cache_helper, r0
9265+
}
9266+
if (!func) {
9267+
|1:
9268+
}
92639269
}
92649270
| // ZEND_CALL_NUM_ARGS(call) = num_args;
92659271
| mov dword EX:RX->This.u2.num_args, opline->extended_value

0 commit comments

Comments
 (0)