From 6188b7a1da3573964ed60b394b0fa10cc2bc4fb7 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 9 Oct 2020 15:05:43 +0200 Subject: [PATCH] Revert "Change calling convention of zval_update_constant[_ex]() to fastcall." This reverts commit 5a447b086bba450d61c283adfecbdec657cc5f34. Revert this ABI break from PHP-8.0, leaving it only on master. --- Zend/zend_execute.h | 4 ++-- Zend/zend_execute_API.c | 4 ++-- ext/opcache/jit/zend_jit_x86.dasc | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 62cee34452..ab96d43c4c 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -155,8 +155,8 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval return variable_ptr; } -ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp); -ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_entry *scope); +ZEND_API zend_result zval_update_constant(zval *pp); +ZEND_API zend_result zval_update_constant_ex(zval *pp, zend_class_entry *scope); /* dedicated Zend executor functions - do not use! */ struct _zend_vm_stack { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 2eb3463eff..7572a0d890 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -610,7 +610,7 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */ } /* }}} */ -ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */ +ZEND_API zend_result zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */ { if (Z_TYPE_P(p) == IS_CONSTANT_AST) { zend_ast *ast = Z_ASTVAL_P(p); @@ -638,7 +638,7 @@ ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *p, zend_class_e } /* }}} */ -ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp) /* {{{ */ +ZEND_API zend_result zval_update_constant(zval *pp) /* {{{ */ { return zval_update_constant_ex(pp, EG(current_execute_data) ? zend_get_executed_scope() : CG(active_class_entry)); } diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index fb932f9de0..d8432d2100 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -12408,10 +12408,19 @@ static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zen } else { | ADDR_OP2_2 mov, aword EX->opline, opline, r0 } - | LOAD_ZVAL_ADDR FCARG1a, res_addr - | mov r0, EX->func - | mov FCARG2a, [r0 + offsetof(zend_op_array, scope)] - | EXT_CALL zval_update_constant_ex, r0 + |.if X64 + | LOAD_ZVAL_ADDR CARG1, res_addr + | mov r0, EX->func + | mov CARG2, [r0 + offsetof(zend_op_array, scope)] + | EXT_CALL zval_update_constant_ex, r0 + |.else + | sub r4, 8 + | mov r0, EX->func + | push dword [r0 + offsetof(zend_op_array, scope)] + | PUSH_ZVAL_ADDR res_addr, r0 + | EXT_CALL zval_update_constant_ex, r0 + | add r4, 16 + |.endif | test al, al | jnz >1 |.cold_code -- 2.40.0