#
f169b26d |
| 08-Jun-2012 |
Nikita Popov |
Fix backtraces and func_get_args() To make the generator function show up in backtraces one has to insert an additional execute_data into the chain, as prev_execute_data->function_state
Fix backtraces and func_get_args() To make the generator function show up in backtraces one has to insert an additional execute_data into the chain, as prev_execute_data->function_state is used to determine the called function. Adding the additional stack frame is also required for func_get_args(), as the arguments are fetched from there too. The arguments have to be copied in order to keep them around. Due to the way they are saved doing so is quite ugly, so I added another function zend_copy_arguments to zend_execute.c which handles this.
show more ...
|
#
ee89e228 |
| 30-May-2012 |
Nikita Popov |
Allow yielding during function calls During function calls arguments are pushed onto the stack. Now these are backed up on yield and restored on resume. This requires memcpy'ing them,
Allow yielding during function calls During function calls arguments are pushed onto the stack. Now these are backed up on yield and restored on resume. This requires memcpy'ing them, but there doesn't seem to be any better way to do it. Also this fixes the issue with exceptions thrown during function calls.
show more ...
|
Revision tags: php-5.3.14RC2 |
|
#
0033a525 |
| 30-May-2012 |
Nikita Popov |
Allow throwing exceptions from generators The missing piece is how one can find the next stack frame, which is required for dtor'ing arguments pushed to the stack. As the generator e
Allow throwing exceptions from generators The missing piece is how one can find the next stack frame, which is required for dtor'ing arguments pushed to the stack. As the generator execute_data does not live on the stack one can't use it to figure out the start of the next stack frame. So there must be some other method.
show more ...
|
Revision tags: php-5.4.4RC2 |
|
#
87901602 |
| 30-May-2012 |
Nikita Popov |
Add auto-increment keys When no key is explicitely yielded PHP will used auto-incrementing keys as a fallback. They behave the same as with arrays, i.e. the key is the successor of t
Add auto-increment keys When no key is explicitely yielded PHP will used auto-incrementing keys as a fallback. They behave the same as with arrays, i.e. the key is the successor of the largest previously used integer key.
show more ...
|
#
bc08c2cf |
| 30-May-2012 |
Nikita Popov |
Add support for yielding keys Keys are yielded using the yield $key => $value syntax. Currently this is implemented as a statement only and not as an expression, be
Add support for yielding keys Keys are yielded using the yield $key => $value syntax. Currently this is implemented as a statement only and not as an expression, because conflicts arise considering nesting and use in arrays: yield yield $a => $b; // could be either yield (yield $a) => $b; // or yield (yield $a => $b); Once I find some way to resolve these conflicts this should be available as an expression too. Also the key yielding code is rather copy-and-past-y for the value yielding code, so that should be factored out.
show more ...
|
#
ad525c28 |
| 29-May-2012 |
Nikita Popov |
Allow to use yield without value If the generator is used as a coroutine it often doesn't make sense to yield anything. In this case one can simply receive values using $val
Allow to use yield without value If the generator is used as a coroutine it often doesn't make sense to yield anything. In this case one can simply receive values using $value = yield; The yield here will simply yield NULL.
show more ...
|
#
3600914c |
| 29-May-2012 |
Nikita Popov |
Add support for $generator->send() Yield now is an expression and the return value is the value passed to $generator->send(). By default (i.e. if ->next() is called) the value is NUL
Add support for $generator->send() Yield now is an expression and the return value is the value passed to $generator->send(). By default (i.e. if ->next() is called) the value is NULL. Unlike in Python ->send() can be run without priming the generator with a ->next() call first.
show more ...
|
#
b770b221 |
| 29-May-2012 |
Nikita Popov |
Make the GOTO and SWITCH VMs work again |
#
4aab08b6 |
| 28-May-2012 |
Nikita Popov |
Properly free resources when generator return value not used To keep things clean two new functions are introduced: zend_clean_and_cache_symbol_table(HashTable *symbol_table) ze
Properly free resources when generator return value not used To keep things clean two new functions are introduced: zend_clean_and_cache_symbol_table(HashTable *symbol_table) zend_free_compiled_variables(zval ***CVs, int num)
show more ...
|
#
9f52c5c2 |
| 27-May-2012 |
Nikita Popov |
Fix generator creation when execute_data is not nested This happens primarily when the generator is invoked from some internal place like a dynamic function call. |
#
64a643a4 |
| 27-May-2012 |
Nikita Popov |
Free loop variables If the generator is closed before it has finished running, it may happen that some FREE or SWITCH_FREE opcodes haven't been executed and memory is leaked.
Free loop variables If the generator is closed before it has finished running, it may happen that some FREE or SWITCH_FREE opcodes haven't been executed and memory is leaked. This fixes it by walking the brk_cont_array and manually freeing the variables.
show more ...
|
#
247bb737 |
| 27-May-2012 |
Nikita Popov |
Add support for generator methods |
#
d49d3971 |
| 26-May-2012 |
Nikita Popov |
Close generator on return |
#
5bb3a995 |
| 26-May-2012 |
Nikita Popov |
Implement return for generators For generators ZEND_RETURN directly calls ZEND_VM_RETURN(), thus passing execution back to the caller (zend_generator_resume). This commit also a
Implement return for generators For generators ZEND_RETURN directly calls ZEND_VM_RETURN(), thus passing execution back to the caller (zend_generator_resume). This commit also adds a check that only return; is used in generators and not return $value;.
show more ...
|
#
fafce586 |
| 26-May-2012 |
Nikita Popov |
Add YIELD opcode implementation |
#
f627be52 |
| 26-May-2012 |
Nikita Popov |
Add support for executing a zend_execute_data This adds another function execute_ex(), which accepts a zend_execute_data struct to run (contrary to execute(), which accepts a zend_op_arr
Add support for executing a zend_execute_data This adds another function execute_ex(), which accepts a zend_execute_data struct to run (contrary to execute(), which accepts a zend_op_array from which it initialized the execute_data). This needs a bit more cleanup.
show more ...
|
#
9ce9a7e6 |
| 23-May-2012 |
Nikita Popov |
Add initial code for suspending execution This is just some initial code, which is still quite broken (and needs to be moved so it can be reused.) |
#
5e763d94 |
| 22-May-2012 |
Nikita Popov |
Allocate execute_data using malloc for generators Generators need to switch the execute_data very often. If the execute_data is allocated on the VM stack this operation would require to
Allocate execute_data using malloc for generators Generators need to switch the execute_data very often. If the execute_data is allocated on the VM stack this operation would require to always copy the structure (which is quite large). That's why the execution context is allocated on the heap instead (only for generators obviously).
show more ...
|
#
46fa26ab |
| 20-May-2012 |
Nikita Popov |
Make generator functions return a Generator object Right now generator functions simply immediately return a new Generator object (no suspension yet). |
#
1cec3f12 |
| 19-May-2012 |
Nikita Popov |
Add ZEND_SUSPEND_AND_RETURN_GENERATOR opcode If the function is a generator this opcode will be invoked right after receiving the function arguments. The current implementation
Add ZEND_SUSPEND_AND_RETURN_GENERATOR opcode If the function is a generator this opcode will be invoked right after receiving the function arguments. The current implementation is just a dummy.
show more ...
|
Revision tags: php-5.3.14RC1, php-5.4.4RC1 |
|
#
d03900dc |
| 13-May-2012 |
Stanislav Malyshev |
fix bug #61782 - __clone/__destruct do not match other methods when checking access controls |
#
a0dff6fd |
| 13-May-2012 |
Stanislav Malyshev |
fix bug #61782 - __clone/__destruct do not match other methods when checking access controls |
Revision tags: php-5.3.13, php-5.4.3, php-5.4.2, php-5.3.12, php-5.3.11, php-5.4.1 |
|
#
565892d4 |
| 15-Apr-2012 |
Xinchen Hui |
Implement const array/string dereference RFC:https://wiki.php.net/rfc/constdereference |
Revision tags: php-5.3.11RC2, php-5.4.1RC2, php-5.3.11RC1, php-5.4.1RC1, PHP-5.4.1-RC1 |
|
#
0876d7bb |
| 02-Mar-2012 |
Xinchen Hui |
MFH: Fixed bug #61011 (Crash when an exception is thrown by __autoload accessing a static property) |
Revision tags: php-5.4.0 |
|
#
229e5563 |
| 25-Feb-2012 |
Xinchen Hui |
Fixed bug #61011 (Crash when an exception is thrown by __autoload accessing a static property) |