Commit graph

49 commits

Author SHA1 Message Date
Nikita Popov
7f5d47dfd1 Merge branch 'PHP-7.1' 2017-04-15 01:40:59 +02:00
Nikita Popov
6c2222796b Improve fix for bug #74442
Make the check less conservative to be consistent with the other
cases.
2017-04-15 01:39:33 +02:00
Nikita Popov
feb828ffb0 Merge branch 'PHP-7.1' 2017-04-14 22:20:48 +02:00
Nikita Popov
2f22dffd1a Fixed bug #74442 2017-04-14 22:20:32 +02:00
Nikita Popov
81b4bfcb96 Merge branch 'PHP-7.1' 2017-04-14 22:04:07 +02:00
Nikita Popov
3ffe2cd251 Fixed bug #74431
If the last instruction in a block is a NOP, then `new_opline`
here won't be a copy of `opline`, it will be a copy of the last
non-NOP opline. Avoid performing a spurious update by explicitly
checking for NOP.
2017-04-14 22:03:06 +02:00
Nikita Popov
ad8652818a Implement jumptable optimization 2017-04-10 22:23:14 +02:00
Dmitry Stogov
141d1ba980 Introduced "zend_type" - an abstraction for type-hinting representation. 2017-01-13 11:37:46 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Nikita Popov
242d924e59 Fix bug #73847 2016-12-31 13:33:21 +01:00
Xinchen Hui
6bd41a1d47 Fixed bug #73789 (Strange behavior of class constants in switch/case block) 2016-12-20 21:01:21 +08:00
Dmitry Stogov
f8f35d0d4e VERIFY_RETURN_TYPE on references can't be eliminated 2016-11-17 10:41:42 +03:00
Dmitry Stogov
b5bab0fce8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72944 (Null pointer deref in zval_delref_p).
2016-08-29 12:07:54 +03:00
Nikita Popov
42260325a4 Fix optimization of $i = $i++ 2016-07-17 22:47:49 +02:00
Nikita Popov
a171522983 Exception safety for direct CV assign of *CALL instrs
Converting T = *CALL; ASSIGN $v, T into $v = *CALL may not be
safe if an exception is thrown after the return value has been
populated -- in this case the value might be destroyed twice.
2016-06-18 00:08:38 +02:00
Nikita Popov
046889518d Add support for "instanceof" pi nodes 2016-06-13 19:03:59 +02:00
Nikita Popov
e6296f0dcc Fix VERIFY_RETURN_TYPE elision
This both fixes incorrect elision and allows elision for cases
where we only have a subset (e.g. true of bool).
2016-06-05 23:44:08 +02:00
Nikita Popov
7b4618e396 Fix SSA NOP removal
NOPs need to be tracked in the shiftlist as well, as there may be
jumps to NOPs.
2016-06-05 23:00:32 +02:00
Nikita Popov
a19eb8e34a Ensure no entry predecessors for SSA construction 2016-05-24 18:29:45 +02:00
Nikita Popov
e745b4cad8 Replace BB end with BB len
And support empty blocks everywhere.
2016-05-24 18:29:44 +02:00
Nikita Popov
0d62dfdf81 Improve previous fix
Do not mark loop var free blocks as reachable after all -- as we
can't construct SSA for unreachable blocks, this would cause
issues down the line.

Instead add an extra UNREACHABLE_FREE flag and retain only the
FREE instruction during NOP removal. (If we retain all
instructions in the BB we might leave a jump instruction that goes
into the nowhere.)
2016-05-22 00:05:06 +02:00
Dmitry Stogov
6d52492906 Update comments consistently (#var0 -> #v) 2016-05-05 14:41:34 +03:00
Dmitry Stogov
542402afdb Refactor DFA pass for better readability 2016-05-05 14:37:41 +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
Nikita Popov
8e5b139732 Evaluate arguments of new for classes without ctor
ML: http://markmail.org/message/4b3mk7jid64zvz34
2016-03-25 19:11:37 +01:00
Dmitry Stogov
d8b75b0807 Convert ASSIGN_ADD $a, $b into $a = ADD $a, $b, if possible. 2016-03-22 23:57:26 +03:00
Dmitry Stogov
94812fa6cd Convert ASSIGN_ADD $cv, int(1) into PRE_INC $cv, if it's safe. 2016-03-22 22:50:43 +03:00
Xinchen Hui
85419b4f28 Unused var 2016-03-18 16:02:32 +08:00
Dmitry Stogov
3f1e35756c Change LONG constants into DOUBLE, if they are going to be used as DOUBLE. 2016-03-17 09:58:15 +03:00
Xinchen Hui
73e8c08788 Sorry for that... Merged by accident....
Revert "Transparently introduce type-specialized opcode handlers."

This reverts commit 59d00b8bcc.
2016-03-17 11:59:15 +08:00
Dmitry Stogov
59d00b8bcc Transparently introduce type-specialized opcode handlers.
This affects only PHP VM, and doesn't change anything else.
2016-03-16 03:36:58 +03:00
Dmitry Stogov
4165ae1420 Convert LONG constants to DOUBLE, when later they are going to be used as DOUBLE 2016-03-15 22:19:01 +03:00
Dmitry Stogov
8026da6db0 Remove NOPs after DFA pass. 2016-03-10 18:31:02 +03:00
Nikita Popov
9a45e920aa Support dropping rc1/rcn from dumps
For non-JIT we're not interested in rc inference.
2016-02-27 15:36:04 +01:00
Dmitry Stogov
b8e30a492a Use more general optimisation patterns 2016-02-26 21:02:41 +03:00
Nikita Popov
5faedf5b3e Remove EXT_TYPE_UNUSED in favor of IS_UNUSED
This means we no longer allocate an unused VAR for the retval of
instructions that support unused results.

Nearly all instructions already used the result variable only if
it was used. The only exception to this was the return value
variable for internal function call results. I've adjusted the code
to use a stack zval for the unused return case now. As we have
retval specialization now, we know that it doesn't matter.
2016-02-11 18:02:19 +01:00
Xinchen Hui
63fb2b7118 Improve the names 2016-01-25 16:00:10 +08:00
Dmitry Stogov
79071fe227 Added optimization constraint (don't optimize result of NEW, because constructor may throw exception) 2016-01-22 13:30:34 +03: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
Dmitry Stogov
b3d0178915 Rearrange code to enable inner precedure inference 2015-12-24 19:05:27 +03:00
Dmitry Stogov
b4def0ee88 Added call-graph analyses 2015-12-24 14:30:41 +03:00
Dmitry Stogov
3d88a64e0c Add another DFA optimization pattern (ASSIGN -> QM_ASSING) 2015-12-24 11:06:02 +03:00
Dmitry Stogov
74daa98974 Added simple DFA optimisation pattern (just to prove the concept) 2015-12-16 13:14:31 +03:00
Dmitry Stogov
c88ffa9a56 Added e-SSA based DFA optimisation framework (incomplete) 2015-12-16 00:49:44 +03:00
Dmitry Stogov
1fdb63fbd9 ws fixes 2015-12-11 17:40:23 +03:00
Dmitry Stogov
f243aaf985 Added e-SSA based DFA optimisation framework (incomplete) 2015-12-11 17:24:55 +03:00