Commit Graph

414 Commits

Author SHA1 Message Date
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
681de72554 Enable DFA pass by default 2016-03-17 22:37:20 +03:00
Dmitry Stogov
fc7cbdce61 Squashed commit of the following:
commit 98471821a8
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 21:56:04 2016 +0300

    Fixed wrong constant usage

commit 8183b811e7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 21:10:23 2016 +0300

    Added ability to serialize and serialize opcode handlers for file-cache

commit 3516b261de
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 10:11:59 2016 +0300

    Added missed file

commit f4475a2360
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 10:00:45 2016 +0300

    Transparently introduce type-specialized opcode handlers.
    This affects only PHP VM, and doesn't change anything else.
2016-03-17 22:00:27 +03:00
Xinchen Hui
adb82514eb Merge branch 'PHP-7.0'
* PHP-7.0:
  Remove unnecessary pattern
  Fixed for PHP7
  Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER)

Conflicts:
	ext/opcache/Optimizer/block_pass.c
2016-03-17 20:24:59 +08:00
Xinchen Hui
aef22ac1c1 Remove unnecessary pattern 2016-03-17 20:21:36 +08:00
Xinchen Hui
041a01fd6c Fixed for PHP7 2016-03-17 20:20:01 +08:00
Xinchen Hui
820b0aa2ab Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER)
2016-03-17 19:54:33 +08:00
Xinchen Hui
8e2f658f49 Fixed bug #71843 (null ptr deref ZEND_RETURN_SPEC_CONST_HANDLER) 2016-03-17 19:54:19 +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
Xinchen Hui
a3940c1867 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  Fix build
  Fix build
  Fix build
  prepare for 5.6.20RC1
  Fix more emails
  More email fixing
  Fix emails in headers. @mysql.com addresses are no more since many years.
  fix #ifdef usage
2016-03-17 11:57:08 +08:00
Kalle Sommer Nielsen
fc49f1c411 Fix build 2016-03-17 03:53:01 +01: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
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
64dae1ea76 Statically bind static method call arguments
If we know what method will be called, use ct-bound send opcodes.

The intl test is changed because a runtime error changed to a
compile-time error.
2016-03-14 17:50:56 +01:00
Dmitry Stogov
8026da6db0 Remove NOPs after DFA pass. 2016-03-10 18:31:02 +03:00
Xinchen Hui
f2d2e8ceb9 arena_alloc never returns NULL 2016-03-09 18:05:28 +08:00
Xinchen Hui
14fec3adf9 Suppress warnings 2016-03-09 18:01:29 +08: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
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
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
Dmitry Stogov
b8e30a492a Use more general optimisation patterns 2016-02-26 21:02:41 +03:00
Dmitry Stogov
791b8f0c89 Merge branch 'PHP-7.0'
* PHP-7.0:
  Set proper type flags (REFCOUNTED and COPYABLE) according to interned or regular string
2016-02-18 23:18:56 +03:00
Dmitry Stogov
796e1629b0 Set proper type flags (REFCOUNTED and COPYABLE) according to interned or regular string 2016-02-18 23:15:38 +03:00
Xinchen Hui
ab5869400b Fixed another assertion fails due to live_range cleaned (ext/phar/tests/003a.phpt) 2016-02-15 14:38:20 +08:00
Xinchen Hui
49399359c6 Restore to the first version fix(sorry, mis-read the codes) 2016-02-15 13:47:52 +08:00
Xinchen Hui
b3f5f5f1be Reset op_array->live_range if it is removed all by optimization 2016-02-15 12:09:52 +08:00
Xinchen Hui
ab3a820aa3 Revert "Fixed segfault in file cache serialize if live range is empty after"
This reverts commit 2661a47479.
2016-02-15 12:09:13 +08:00
Xinchen Hui
2661a47479 Fixed segfault in file cache serialize if live range is empty after
optimiaztion
2016-02-15 12:07:43 +08:00
Nikita Popov
44ed1cb5c0 Remove ZEND_CALL_CTOR_RESULT_UNUSED
Instead emit a FREE on the result of NEW.
2016-02-11 22:15:11 +01:00
Dmitry Stogov
8c2d55962e Combine conditions 2016-02-11 23:11:19 +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
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
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
Dmitry Stogov
1544fec94b Removed wrong (old) code 2016-02-08 12:20:37 +03:00
Nikita Popov
80c15ac784 Move pi placement into separate function
Non-functional change, just moving code. This makes it easier to
change the order of operations.
2016-02-02 17:39:59 +01:00
Xinchen Hui
63fb2b7118 Improve the names 2016-01-25 16:00:10 +08:00
Nikita Popov
319e82838a Remove dead code
OP_DATA isn't used in that way anymore
2016-01-24 23:04:15 +01:00
Nikita Popov
c2fea2a46d Respect RC_INFERENCE during DFG construction
To avoid inserting phis that are only relevant with rc inference
enabled. Suprisingly, this affects only 0.8% of phis.
2016-01-24 23:04:06 +01:00
Nikita Popov
949aaea66e Don't insert duplicate predecessors
Otherwise we'll get corrupt phis
2016-01-24 23:03:57 +01: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
Dmitry Stogov
9b854ebab4 More accurate handling of isset() and unset() 2016-01-22 13:32:20 +03: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
Nikita Popov
b1e4883d26 Don't print try-catch offset for FAST_RET w/o ev 2016-01-21 21:53:13 +01:00
Nikita Popov
9b57e07298 Consolidate op1/op2 vm flags 2016-01-21 21:15:05 +01:00
Nikita Popov
dcf3db6ac8 Mark isset($$var) as INDIRECT_VAR_ACCESS 2016-01-19 22:26:32 +01:00