mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Simplify call frame initialization
This commit is contained in:
parent
0d91b046a3
commit
cc900edd77
12 changed files with 392 additions and 344 deletions
|
@ -634,6 +634,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
|||
zend_execute_data *call, dummy_execute_data;
|
||||
zend_fcall_info_cache fci_cache_local;
|
||||
zend_function *func;
|
||||
uint32_t call_info;
|
||||
void *object_or_called_scope;
|
||||
|
||||
ZVAL_UNDEF(fci->retval);
|
||||
|
||||
|
@ -695,11 +697,18 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
|
|||
}
|
||||
|
||||
func = fci_cache->function_handler;
|
||||
fci->object = (func->common.fn_flags & ZEND_ACC_STATIC) ?
|
||||
NULL : fci_cache->object;
|
||||
if ((func->common.fn_flags & ZEND_ACC_STATIC) || !fci_cache->object) {
|
||||
fci->object = NULL;
|
||||
object_or_called_scope = fci_cache->called_scope;
|
||||
call_info = ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC;
|
||||
} else {
|
||||
fci->object = fci_cache->object;
|
||||
object_or_called_scope = fci->object;
|
||||
call_info = ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC | ZEND_CALL_HAS_THIS;
|
||||
}
|
||||
|
||||
call = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC,
|
||||
func, fci->param_count, fci_cache->called_scope, fci->object);
|
||||
call = zend_vm_stack_push_call_frame(call_info,
|
||||
func, fci->param_count, object_or_called_scope);
|
||||
|
||||
if (UNEXPECTED(func->common.fn_flags & ZEND_ACC_DEPRECATED)) {
|
||||
zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue