Commit Graph

17 Commits

Author SHA1 Message Date
Nikita Popov
904a83a137 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	ext/opcache/Optimizer/optimize_func_calls.c
2014-08-16 22:31:13 +02:00
Nikita Popov
f72d6f97ec ZEND_INIT_FCALL_BY_NAME can have non-string literal 2014-08-15 22:55:15 +02:00
Xinchen Hui
101c055396 Add copyright header 2014-08-15 16:47:54 +08:00
Xinchen Hui
e2522b4f1d Remove old version PHP supports 2014-08-15 16:40:07 +08:00
Dmitry Stogov
de306e7088 Implement call_user_func() and call_user_func_array() using special opcodes.
In some rare cases it leads to insignificant changes in error messages.
2014-07-11 00:32:18 +04:00
Dmitry Stogov
b36aaea6ed ZEND_SEND_VAR and ZEND_SEND_VAL specialization 2014-07-08 02:13:53 +04:00
Dmitry Stogov
b7715c7e8a 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.
2014-06-30 15:43:45 +04:00
Dmitry Stogov
a4f38192ec Use arena allocator for optimizer temporary data structures 2014-06-18 17:09:37 +04:00
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Dmitry Stogov
5324f22f59 ext/opcache refactoring (incomplete) 2014-03-28 23:34:49 +04:00
Dmitry Stogov
77bc5b8bae We don't know PHP_5_6_X_API_NO yet 2014-01-15 11:09:38 +04:00
Nikita Popov
a5ee337156 Fixed arguments unpacking segfault with opcache 2014-01-14 22:34:08 +08:00
Xinchen Hui
676e737f5b Fix other typos & add test script 2013-04-19 11:21:44 +08:00
Xinchen Hui
580d6fe94d Fix typo 2013-04-19 10:55:11 +08:00
Felipe Pena
1192cfa58c - Fixed ZTS build 2013-04-18 19:27:02 -03:00
Dmitry Stogov
60a59d27b4 Disable FCALL optimization pass for PHP older than 5.4 2013-04-18 22:22:48 +04:00
Dmitry Stogov
edfeab8bf2 Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL. 2013-04-18 22:12:31 +04:00