summaryrefslogtreecommitdiff
path: root/Zend/zend_generators.h
Commit message (Collapse)AuthorAgeFilesLines
* Trailing whitespaces on ZendGabriel Caruso2018-01-041-1/+1
| | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* year++Xinchen Hui2018-01-021-1/+1
|
* further sync for vim mode linesAnatol Belski2017-07-041-0/+2
|
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* fix exports which are now referenced by phpdbgAnatol Belski2016-09-281-2/+2
|
* Add phpdbg generator commandBob Weinand2016-09-281-0/+3
|
* Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast ↵Dmitry Stogov2016-05-131-1/+0
| | | | | | | path of DO_FCALL* handlers. This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization. Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
* Use main VM stack for generators. Only single call frame for generator ↵Dmitry Stogov2016-05-121-2/+2
| | | | itself is allocated on heap, call frames for nested functions are allocated on main VM stack. In case "yield" used in context of another function call, call stack has to be frozen and then restored.
* Fix bug #69989Nikita Popov2016-02-121-0/+1
| | | | | This should cover all the basic cycles. Anything further would require scanning the call stack and live temporaries.
* Support partial GC for unfinished generatorsNikita Popov2016-02-111-1/+3
| | | | | This doesn't cover everything yet, but should be a good start for cycled in unfinished generators.
* bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
|
* Unused varXinchen Hui2015-09-191-1/+1
|
* Set expectations in generator handlingBob Weinand2015-09-201-1/+22
|
* "This" is C++ keywordXinchen Hui2015-07-301-1/+1
|
* Add NEWS/UPGRADING and some implementation notesBob Weinand2015-04-141-1/+9
|
* Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-srcBob Weinand2015-04-141-2/+41
|\
| * Added yield from operatorBob Weinand2015-03-071-10/+35
| |
| * WIPNikita Popov2015-02-281-0/+15
| |
| * Implement Generator::getReturn()Nikita Popov2015-02-191-0/+2
| |
* | Implement Generator::getReturn()Nikita Popov2015-03-171-0/+2
|/ | | | | Conflicts: Zend/zend_vm_execute.h
* bump yearXinchen Hui2015-01-151-1/+1
|
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-4/+4
|
* master renames phase 1Anatol Belski2014-08-251-1/+1
|
* first shot on merging the core fro the int64 branchAnatol Belski2014-08-161-1/+1
|
* Simplify call-frame handlingDmitry Stogov2014-07-071-1/+1
|
* Fixed destruction of objects and iterators on unclean request shutdown and ↵Dmitry Stogov2014-04-091-1/+1
| | | | | | GC (few cases are still unfixed). Now we destroy objects it two steps. At first - object properties of all objects and only then the objects their selves.
* Refactoring zend_iterator (incompleted)Xinchen Hui2014-02-271-9/+1
|
* Use better data structures (incomplete)Dmitry Stogov2014-02-101-4/+4
|
* Bump yearXinchen Hui2014-01-031-1/+1
|
* Fixed bug #66041: list() fails to unpack yielded ArrayAccess objectNikita Popov2013-11-301-1/+1
| | | | | | Yield return values now use IS_VAR rather than IS_TMP_VAR. This fixes the issue with list() and should also be faster as it avoids doing a zval copy.
* Fixed linkage with C++Dmitry Stogov2013-04-221-1/+3
|
* Happy New YearXinchen Hui2013-01-011-1/+1
|
* - generators API exported for extensionsDmitry Stogov2012-12-111-3/+3
| | | | - improved RETURN sequence to avoid redundant check if op_array is a generator
* . The VM stacks for passing function arguments and syntaticaly nested calls ↵Dmitry Stogov2012-11-301-13/+12
| | | | | | were merged into a single stack. The stack size needed for op_array execution is calculated at compile time and preallocated at once. As result all the stack push operatins don't require checks for stack overflow any more. . Generators implementation was improved using the new VM stack. Now it's a bit more clear and faster.
* Fixed bug #63132Nikita Popov2012-09-221-0/+5
| | | | | | | | | | | | | | EG(arg_types_stack) is now also backed up when generators are used. This allows the use of yield in nested method calls. This commit adds two new functions to the zend_ptr_stack API: zend_ptr_stack_push_from_memory zend_ptr_stack_pop_into_memory both taking the following arguments: zend_ptr_stack *stack, int count, void **pointers
* Fix several issues and allow rewind only at/before first yieldNikita Popov2012-08-251-3/+8
| | | | | | | | * Trying to resume a generator while it is already running now throws a fatal error. * Trying to use yield in finally while the generator is being force-closed (by GC) throws a fatal error. * Rewinding after the first yield now throws an Exception
* Run finally if generator is closed before finishingNikita Popov2012-08-241-0/+1
|
* Fix zts build (typo)Nikita Popov2012-08-201-1/+1
|
* Drop Generator::close() methodNikita Popov2012-08-201-4/+0
|
* Remove asterix modifier (*) for generatorsNikita Popov2012-07-201-0/+1
| | | | | | | | | | | | | | | | Generators are now automatically detected by the presence of a `yield` expression in their body. This removes the ZEND_SUSPEND_AND_RETURN_GENERATOR opcode. Instead additional checks for ZEND_ACC_GENERATOR are added to the fcall_common helper and zend_call_function. This also adds a new function zend_generator_create_zval, which handles the actual creation of the generator zval from an op array. I feel like I should deglobalize the zend_create_execute_data_from_op_array code a bit. It currently changes EG(current_execute_data) and EG(opline_ptr) which is somewhat confusing (given the name).
* Disallow closing a generator during its executionNikita Popov2012-06-231-0/+4
| | | | | If a generator is closed while it is running an E_WARNING is thrown and the call is ignored. Maybe a fatal error should be thrown instead?
* Allow yielding during function callsNikita Popov2012-05-311-0/+10
| | | | | | | | 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.
* Add auto-increment keysNikita Popov2012-05-301-0/+2
| | | | | | 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.
* Add support for yielding keysNikita Popov2012-05-301-0/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* Add support for $generator->send()Nikita Popov2012-05-291-0/+2
| | | | | | | | | 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.
* Free loop variablesNikita Popov2012-05-271-1/+1
| | | | | | | | | 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.
* Close generator on returnNikita Popov2012-05-261-4/+5
|
* Add support for executing a zend_execute_dataNikita Popov2012-05-261-0/+2
| | | | | | | | 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.
* Add initial code for suspending executionNikita Popov2012-05-231-0/+7
| | | | | This is just some initial code, which is still quite broken (and needs to be moved so it can be reused.)
* Add empty Generator classNikita Popov2012-05-201-0/+40