Commit Graph

19 Commits

Author SHA1 Message Date
Kalle Sommer Nielsen
fc49f1c411 Fix build 2016-03-17 03:53:01 +01:00
Nikita Popov
8d758e7be9 Fix dominator tree construction
The used dominator intersection algorithm assumes a postorder
numbering of the CFG. The reversal of our natural numbering is
quite similar to postorder, but not the same.

In the future we should precompute both preorder/postorder
numberings and orderings, as these are useful in many places.
2016-02-27 15:10:18 +01:00
Nikita Popov
7174af4074 Support CFG construction without live range splitting
We must not split at live range boundaries for SSA constructions,
otherwise an OP_DATA instruction may be separated into new block
and not picked up during renaming.

It's also unnecessary for this use case and only blows up the CFG.
2016-02-09 13:02:33 +01:00
Nikita Popov
949aaea66e Don't insert duplicate predecessors
Otherwise we'll get corrupt phis
2016-01-24 23:03:57 +01:00
Dmitry Stogov
9b854ebab4 More accurate handling of isset() and unset() 2016-01-22 13:32:20 +03:00
Nikita Popov
dcf3db6ac8 Mark isset($$var) as INDIRECT_VAR_ACCESS 2016-01-19 22:26:32 +01:00
Dmitry Stogov
a8900b5636 Typo (ASSESS->ACCESS) 2016-01-19 15:54:44 +03:00
Dmitry Stogov
a2ff3a46a4 Use ZEND_FUNC_INDIRECT_VAR_ASSESS instead of ZEND_FUNC_TOO_DYNAMIC. Handle function with exceptions handlers and generators separately. 2016-01-19 15:33:08 +03:00
Lior Kaplan
71c1980025 Happy new year (Update copyright to 2016) 2016-01-01 20:06:12 +02:00
Nikita Popov
83c4417330 Mark uses of scope functions in namespaces as TOO_DYNAMIC
Of course they are not necessarily, but it's very likely and we have
to be conservative anyway.

Also use zend_string_equals_literal().
2015-12-30 23:38:03 +01:00
Nikita Popov
65e456f364 Introduce BIND_LEXICAL
This opcodes inserts a local CV into the closure static variable
table. This replaces the previous mechanism of having static
variables marked as LEXICAL, which perform a symtable lookup
during copying.

This means a) functions which contain closures no longer have to
rebuild their symtable (better performance) and b) we can now track
used variables in SSA.
2015-12-29 23:14:53 +01:00
Nikita Popov
88eae43ff9 Remove uses of VARs in extended_value
The DECLARE_(ANON_)INHERITED_CLASS(_DELAYED) opcodes were
referencing the parent ce VAR through extended_value. This is
hacky and we can't track the def-use chain in SSA.

To avoid this, the layout of declaration opcodes is changed
as follows: op1 points to the lcname and rtd_key literals, in
that order. (For anon/lambda declarations only one of lcname or
rtd_key is present.) This frees up op2, which is now used to
reference the parent ce VAR in inheriting declarations. The
jmp offset for anon class declarations is moved frop op2 to
extended_value.

The changes were applied both to class and function declarations
to keep everything symmetric.
2015-12-21 14:44:42 +01:00
Dmitry Stogov
9044f491cc Use do_alloca() instead of alloca() 2015-12-16 04:59:05 +03:00
Dmitry Stogov
c88ffa9a56 Added e-SSA based DFA optimisation framework (incomplete) 2015-12-16 00:49:44 +03:00
Dmitry Stogov
f243aaf985 Added e-SSA based DFA optimisation framework (incomplete) 2015-12-11 17:24:55 +03:00
Dmitry Stogov
404e003cf1 Delete empty live-ranges 2015-12-09 05:16:30 +03:00
Dmitry Stogov
4d49736155 cleanup 2015-11-21 01:19:45 +03:00
Dmitry Stogov
02fad0414b Fixed wrong BB.flags initialization 2015-11-20 23:32:27 +03:00
Dmitry Stogov
b3393baa5d Refactored CFG based optimization using new CFG representation.
Squashed commit of the following:

commit 907533390678f58eac738040ef62a40788048bef
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 21:25:28 2015 +0300

    cleanup

commit 82f7e6f5bb434f12e9fdf45f597be351527f383c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 21:22:01 2015 +0300

    Update build system

commit 8fd83d843fde3f486692de4e2c6b7d64d4192704
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 20:50:32 2015 +0300

    Reachable blocks can't be empty

commit 5822a36269833930a35cb3547222357118b11310
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 19:11:02 2015 +0300

    added missing constraints

commit 2d0c00b243479924de0260ae8d80d624c36994a3
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 19:03:12 2015 +0300

    optimization

commit 29d1e5eb210c51b052cac4d6c232aaa2c724dbbb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 18:34:11 2015 +0300

    Added missing optimization patterns

commit 38dd3b3f2459f5193c742633213f41d78326ea28
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 17:47:06 2015 +0300

    zend_optimize_block() refactoring

commit 3dc97bd1f6d433dff0617338382347b6d0c08f84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 14:30:32 2015 +0300

    We don't use CFG back-references anymore

commit 2242c9e0aa741d287146ad43179650796f199f2d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 14:16:03 2015 +0300

    Consistent naming

commit 64f2856716069390ed7703ac88905cebf5e04023
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 13:29:32 2015 +0300

    Optimization and separate building of direct CFG from predecessrs calculation

commit 9389be4869b13ec45df5dbd443015d2ac539a347
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 10:44:19 2015 +0300

    Use CFG without back references (incomplete, but works)

commit 3d3ecd4b883959cf7b86c33622183295f913924e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 20 00:50:09 2015 +0300

    Fixed iteration in reverse order

commit 52f7fde0c3dfa4b4591519828ebdb238c2377936
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 19 18:35:09 2015 +0300

    Separate debugging code into zend_dump.c

commit 4193a039ea96bae41baf97c6e458f419e8dbf9c5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 19 17:22:04 2015 +0300

    Remove unused code

commit 4228fdc57d8d120e1dad4e4d44045fa1a6f06fe0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 19 17:21:20 2015 +0300

    Remove dead live-ranges only on assembling basic blocks

commit 9a4a7966edf19b92678876f85565700694205598
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 19 15:26:29 2015 +0300

    New CFG representation (incomplete)
2015-11-20 22:06:36 +03:00