Skip to content

Commit 6188b7a

Browse files
committed
Revert "Change calling convention of zval_update_constant[_ex]() to fastcall."
This reverts commit 5a447b0. Revert this ABI break from PHP-8.0, leaving it only on master.
1 parent cc58347 commit 6188b7a

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

Zend/zend_execute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
155155
return variable_ptr;
156156
}
157157

158-
ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp);
159-
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *pp, zend_class_entry *scope);
158+
ZEND_API zend_result zval_update_constant(zval *pp);
159+
ZEND_API zend_result zval_update_constant_ex(zval *pp, zend_class_entry *scope);
160160

161161
/* dedicated Zend executor functions - do not use! */
162162
struct _zend_vm_stack {

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */
610610
}
611611
/* }}} */
612612

613-
ZEND_API zend_result ZEND_FASTCALL zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
613+
ZEND_API zend_result zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
614614
{
615615
if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
616616
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
638638
}
639639
/* }}} */
640640

641-
ZEND_API zend_result ZEND_FASTCALL zval_update_constant(zval *pp) /* {{{ */
641+
ZEND_API zend_result zval_update_constant(zval *pp) /* {{{ */
642642
{
643643
return zval_update_constant_ex(pp, EG(current_execute_data) ? zend_get_executed_scope() : CG(active_class_entry));
644644
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12408,10 +12408,19 @@ static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const zen
1240812408
} else {
1240912409
| ADDR_OP2_2 mov, aword EX->opline, opline, r0
1241012410
}
12411-
| LOAD_ZVAL_ADDR FCARG1a, res_addr
12412-
| mov r0, EX->func
12413-
| mov FCARG2a, [r0 + offsetof(zend_op_array, scope)]
12414-
| EXT_CALL zval_update_constant_ex, r0
12411+
|.if X64
12412+
| LOAD_ZVAL_ADDR CARG1, res_addr
12413+
| mov r0, EX->func
12414+
| mov CARG2, [r0 + offsetof(zend_op_array, scope)]
12415+
| EXT_CALL zval_update_constant_ex, r0
12416+
|.else
12417+
| sub r4, 8
12418+
| mov r0, EX->func
12419+
| push dword [r0 + offsetof(zend_op_array, scope)]
12420+
| PUSH_ZVAL_ADDR res_addr, r0
12421+
| EXT_CALL zval_update_constant_ex, r0
12422+
| add r4, 16
12423+
|.endif
1241512424
| test al, al
1241612425
| jnz >1
1241712426
|.cold_code

0 commit comments

Comments
 (0)