com php-src: Refactored parameter passing mechanism.: Zend/zend_API.c Zend/zend_builtin_functions.c Zen d/zend_closures.c Zend/zend_compile.c
Zend/zend_c ompile.h Zend/zend_execute.c Zend/zend_execute.h Zend/zend_execute_API.c Zend/zend_generators.c Zend/zend_object_handlers.c
Zend/zend_opcode.c Zend/zend_vm_def.h Zend/zend_vm_execute.h Ze nd/zend_vm_execute.skl Zend/zend_vm_opcodes.c Z end/zend_vm_opcodes.h
ext/opcache/Optimizer/block_pas s.c ext/opc
| From: | Dmitry Stogov | Date: | Mon, 30 Jun 2014 11:43:45 +0000 |
| Subject: | com php-src: Refactored parameter passing mechanism.: Zend/zend_API.c Zend/zend_builtin_functions.c Zen d/zend_closures.c Zend/zend_compile.c Zend/zend_c ompile.h Zend/zend_execute.c Zend/zend_execute.h Zend/zend_execute_API.c Zend/zend_generators.c Zend/zend_object_handlers.c Zend/zend_opcode.c Zend/zend_vm_def.h Zend/zend_vm_execute.h Ze nd/zend_vm_execute.skl Zend/zend_vm_opcodes.c Z end/zend_vm_opcodes.h ext/opcache/Optimizer/block_pas s.c ext/opc |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79152@lists.php.net to get a copy of this message | ||
Commit: b7715c7e8a6166f84d9c4d6e35bffef853cabc5c
Author: Dmitry Stogov <dmitry@zend.com> Mon, 30 Jun 2014 15:43:45 +0400
Parents: 9c96d966bbe7e5d3743498539822247fa5763c44
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b7715c7e8a6166f84d9c4d6e35bffef853cabc5c
Log:
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.
Changed paths:
M Zend/zend_API.c
M Zend/zend_builtin_functions.c
M Zend/zend_closures..c
M Zend/zend_compile.c
M Zend/zend_compile.h
M Zend/zend_execute.c
M Zend/zend_execute.h
M Zend/zend_execute_API.c
M Zend/zend_generators.c
M Zend/zend_object_handlers.c
M Zend/zend_opcode.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
M Zend/zend_vm_execute.skl
M Zend/zend_vm_opcodes.c
M Zend/zend_vm_opcodes.h
M ext/opcache/Optimizer/block_pass.c
M ext/opcache/Optimizer/compact_literals.c
M ext/opcache/Optimizer/optimize_func_calls.c
M ext/opcache/Optimizer/pass1_5.c
M ext/opcache/Optimizer/zend_optimizer.c
M ext/opcache/Optimizer/zend_optimizer_internal.h
M ext/phar/phar_object.c
M ext/spl/php_spl.c
M sapi/cli/php_cli.c
M sapi/fpm/fpm/fpm_php_trace.c
Diff: <Diff exceeded maximum size>