Commit Graph

171 Commits

Author SHA1 Message Date
Dmitry Stogov
ea2e1bb1eb Optimized zend_leave_helper() 2014-04-18 13:46:36 +04:00
Dmitry Stogov
5c02e0fc5f Cache op_array->run_time_cache in zend_execute_data for faster access 2014-04-17 16:36:04 +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
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Xinchen Hui
a0690ff288 Fixed zend_object_get_t in simpleXML 2014-04-15 11:05:03 +08:00
Dmitry Stogov
bf35b22af5 Optimized ISSET_ISEMPTY_DIM_OBJ 2014-04-07 14:56:34 +04:00
Dmitry Stogov
8b2bb30137 Use macros 2014-04-07 10:57:58 +04:00
Dmitry Stogov
eaeb3c39b4 Optimized RECV_* opcodes 2014-04-04 14:36:34 +04:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Dmitry Stogov
c6cba55454 Use ZVAL_DEREF() macro 2014-03-27 13:39:09 +04:00
Dmitry Stogov
54d559d893 Replaced (Z_TYPE(x) == IS_REFERENCE) with (Z_ISREF(x)) 2014-03-27 11:50:45 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Dmitry Stogov
aa5f55306b Refactored EG(active_symbol_table) to be zend_array* instead of HashTable* 2014-03-17 23:15:22 +04:00
Xinchen Hui
9a4e16db6f Fixed zend_is_true to support IS_REFERENCE 2014-03-05 22:31:02 +08:00
Dmitry Stogov
3733737328 Handle interned strings as non-refcounted scalars 2014-03-05 13:55:56 +04:00
Dmitry Stogov
1be0df935f Fixed destruction of VM handler operands (FREE_OP1 and family) 2014-03-04 12:27:50 +04:00
Dmitry Stogov
ff61b46941 Use better data structures (incomplete) 2014-02-19 16:50:09 +04:00
Dmitry Stogov
5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Dmitry Stogov
a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Dmitry Stogov
0e425121b3 Use better data structures (incomplete) 2014-02-17 11:50:32 +04:00
Dmitry Stogov
4e66abad54 Use better data structures (incomplete) - refactored return_value handling 2014-02-12 14:29:51 +04:00
Dmitry Stogov
e2ea9a7319 Use better data structures (incomplete) 2014-02-12 11:42:27 +04:00
Dmitry Stogov
f4cfaf36e2 Use better data structures (incomplete) 2014-02-10 10:04:30 +04:00
Xinchen Hui
0f53e37494 Merge branch 'PHP-5.6' 2014-01-03 11:09:07 +08:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Kalle Sommer Nielsen
d14670ccdb Eliminate another TSRMLS_FETCH() in i_zend_is_true()
# Affected extensions have all been updated, ext/opcache and ext/zip
# both have macros for cross version compatibility
2013-12-18 07:25:05 +01:00
krakjoe
1a1e83a5d9 export more Zend API 2013-11-20 16:24:22 +00:00
krakjoe
f046189e34 export more Zend API 2013-11-17 22:39:31 +00:00
Dmitry Stogov
3b2ca392f1 Removed unnecessary GC checks 2013-10-31 11:33:39 +04:00
Nikita Popov
bdfa03d79d Save a TSRMLS_FETCH() for zval_ptr_dtor in executor
This gives me about 9% improvement on Zend/bench.php for a zts build.
2013-09-14 23:02:26 +02:00
Nikita Popov
592677d810 Fix intl build
Turns out that you can't use implicit void pointer casts if intl
is compiled.
2013-08-22 11:46:51 +02:00
Nikita Popov
fc16b92313 Fix bug #46311: Pointer aliasing issue results in miscompile on gcc4.4
The code violated the strict aliasing restriction, because it
dereferenced the same pointer as zval** once and as void**
afterwards. Now both occurances dereference void** and cast to
zval* in the former case.
2013-08-22 10:56:50 +02:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Dmitry Stogov
438cd86378 Removed unnecessary checks 2012-12-13 17:29:30 +04:00
Dmitry Stogov
ff1e1d7a8e Removed redundand checks from release build 2012-12-13 14:46:44 +04:00
Dmitry Stogov
7651d64556 Optimized access to temporary and compiled VM variables 2012-12-04 10:14:39 +04:00
Dmitry Stogov
70f83f35d0 . The VM stacks for passing function arguments and syntaticaly nested calls 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.
2012-11-30 13:39:23 +04:00
Stanislav Malyshev
531e2533dd Use zend_execute_internal always to call internal functions 2012-10-05 08:14:20 +02:00
Nikita Popov
c9709bfbd7 Remove asterix modifier (*) for generators
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).
2012-07-20 16:09:06 +02:00
Nikita Popov
6233408a2a Fix thread safe build 2012-06-20 21:31:23 +02:00
Nikita Popov
f169b26dd7 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.
2012-06-09 00:40:47 +02:00
Nikita Popov
4aab08b64c 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)
2012-05-28 06:43:18 +02:00
Nikita Popov
f627be5254 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.
2012-05-26 17:53:13 +02:00
Felipe Pena
8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov
e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Dmitry Stogov
68e154b1bf reduced size of temp_variariable 2010-10-22 14:51:07 +00:00
Derick Rethans
0e24a7c400 - Strip out the typehint *checks* only. They are still parsed, and they are
still accessible through the reflection API.
2010-10-19 10:42:38 +00:00