Commit graph

228 commits

Author SHA1 Message Date
Dmitry Stogov
aed4249653 Fixed handling of return statement without a value. 2016-04-07 18:59:04 +03:00
Dmitry Stogov
3444c1ae24 Use return type hints for type inference and eliminate useless VERIFY_RETRUN_TYPE opcodes. 2016-04-07 17:34:53 +03:00
Dmitry Stogov
82050dfd3c fixed type inference mistake (typo) 2016-04-01 20:29:54 +03:00
Dmitry Stogov
f3c70f118c Manual CSE 2016-03-31 17:26:27 +03:00
Kalle Sommer Nielsen
fc49f1c411 Fix build 2016-03-17 03:53:01 +01:00
Nikita Popov
47391961dd Mark uses in UNSET_VAR op1 + FE_FETCH_R op2 as no_val 2016-03-14 17:57:07 +01:00
Nikita Popov
a1c48d5e3a Various SSA-related tweaks
* Add FETCH_LIST to inference
* Restrict JMP_SET/COALESCE result type
* Fix typos in range inference
* Add const annotations in zend_ssa.h
* For pi statements dump the associated predecessor block
* If type can be both true and false, dump bool instead
2016-02-28 21:38:34 +01:00
Dmitry Stogov
4095d5f245 Cleanup OP_DATA usage. Now only first operand of OP_DATA is used for ASSIGN_DIM, ASSIGN_OBJ and ASSIGN_OP (DIM/OBJ) instructions. 2016-02-09 13:12:57 +03:00
Dmitry Stogov
f4bec6e137 After DFA pass result of FE_FETCH may be CV 2016-02-09 12:16:17 +03:00
Nikita Popov
cf6aa46dbd Fix SSA for ZEND_YIELD
Yield-by-ref defs a ref var, yield-by-var only defs an rc1/rcn var
if rc inference is used.

Also move BIND_LEXICAL where it belongs in DFG construction.
2016-01-24 23:03:50 +01:00
Nikita Popov
5662d73528 Add support for Pi type constraints
Supports TYPE_CHECK and IS_IDENTICAL for now.
2016-01-19 22:09:29 +01: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
Dmitry Stogov
6579e48417 Introduced BIND_STATIC opcode instead of FETCH_R/FETCH_W(static)+ASSIGN/ASSIGN_REF (similar to BIND_GLOBAL).
In the future we may refer to static variable by index instead of name, to eliminate hash lookup.
2016-01-12 12:20:35 +03:00
Nikita Popov
c602ac60b9 Fix CE fetching for NEW object type inference
Create a common function for getting a class entry.
2016-01-07 18:53:10 +01:00
Nikita Popov
04dc5d7420 Range&type inference for JMP_SET 2016-01-07 18:53:02 +01:00
Lior Kaplan
71c1980025 Happy new year (Update copyright to 2016) 2016-01-01 20:06:12 +02: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
33870c525a Don't reuse SSA var in UNSET_VAR
Instead use the SSA var that UNSET_VAR actually defines. Otherwise
we get issues trying to DCE unsets.
2015-12-26 23:33:58 +01:00
Dmitry Stogov
b3d0178915 Rearrange code to enable inner precedure inference 2015-12-24 19:05:27 +03:00
Dmitry Stogov
a75c6d5fb2 Skip "useless" SSA variables for INIT_ARRAY, ADD_ARRAY_ELEMENT, FE_RESET_R 2015-12-22 17:35:08 +03:00
Dmitry Stogov
b4b6d58990 Add ability to prevent "useless" SSA variable creation for "refcounting inference". 2015-12-22 16:43:37 +03:00
Dmitry Stogov
83cd828469 Make RC1/RCN inference more accurate (it's probably not 100% correct anyway) 2015-12-22 15:35:17 +03:00
Dmitry Stogov
d952eb753c Get rid of MAY_BE_DEF 2015-12-21 19:46:55 +03:00
Dmitry Stogov
ae303cf82f Split MAY_BE_NULL from MAY_BE_UNDEF 2015-12-21 18:39:24 +03:00
Nikita Popov
0da1378a88 long -> zend_long in range inference 2015-12-20 00:06:12 +01:00
Nikita Popov
7cc3089d8f Clone cannot return reference 2015-12-18 17:37:13 +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