diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-06-30 15:43:45 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-06-30 15:43:45 +0400 |
commit | b7715c7e8a6166f84d9c4d6e35bffef853cabc5c (patch) | |
tree | b1681d7735741e41a68ed4d68e9a057065ba2b59 /sapi | |
parent | 9c96d966bbe7e5d3743498539822247fa5763c44 (diff) | |
download | php-git-b7715c7e8a6166f84d9c4d6e35bffef853cabc5c.tar.gz |
Refactored parameter passing mechanism.
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.
There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/cli/php_cli.c | 1 | ||||
-rw-r--r-- | sapi/fpm/fpm/fpm_php_trace.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index d353b00a06..ec76f37715 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1102,7 +1102,6 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ memset(&execute_data, 0, sizeof(zend_execute_data)); EG(current_execute_data) = &execute_data; - EX(function_state).function = pce->constructor; zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, &arg); if (EG(exception)) { diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c index 925f2de64e..d5b4242fc3 100644 --- a/sapi/fpm/fpm/fpm_php_trace.c +++ b/sapi/fpm/fpm/fpm_php_trace.c @@ -42,6 +42,8 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC) /* {{{ */ { +// TODO: fpm_php_trace_dump() has to be reimplemented ??? +#if 0 int callers_limit = 20; pid_t pid = child->pid; struct timeval tv; @@ -131,6 +133,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC break; } } +#endif return 0; } /* }}} */ |