Commit Graph

706 Commits

Author SHA1 Message Date
Xinchen Hui
07a05836de Merge branch 'PHP-7.0' 2015-11-25 20:20:51 +08:00
Xinchen Hui
9376e8213c ZEND_SPACESHIP supports 2015-11-25 20:20:05 +08:00
Xinchen Hui
1e9fcb49ac conflicts variable name 2015-11-20 19:03:18 -08: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
Dmitry Stogov
d6308afce9 Proper optmisation of "goto" into the middle of "try" block. 2015-11-19 11:19:06 +03:00
Dmitry Stogov
df63ec564e minor fixes 2015-11-18 23:03:20 +03:00
Dmitry Stogov
104a597113 Eliminate unreachable live ranges 2015-11-18 18:04:02 +03:00
Dmitry Stogov
66b953e022 Eliminate unreachable catch blocks 2015-11-18 15:34:28 +03:00
Dmitry Stogov
af47326b38 Extended Debug info with live-ranges and excepton-table. 2015-11-18 13:14:57 +03:00
Dmitry Stogov
a6cc322b4d Added internal debug log for block pass. 2015-11-18 02:47:39 +03:00
Dmitry Stogov
030fab6233 Two step optimization for JMPZNZ L,L; L: JMPZ L+1; L: JMPNZ L+1. 2015-11-18 02:45:58 +03:00
Dmitry Stogov
854e8ebb4f Move JMPZNZ L,L; L: JMPZ L+1; L: JMPNZ L+1 optimization patterns from zend_jmp_optimization() into zend_optimize_block() because the value of Tsource in zend_jmp_optimization() is inconsistent.
Fixed compilation warnings.
2015-11-17 21:07:01 +03:00
Dmitry Stogov
6cb3d90f0f Skip first basic block (we skiped it before) 2015-11-17 19:02:39 +03:00
Dmitry Stogov
7de190898d cleanup 2015-11-17 11:24:16 +03:00
Dmitry Stogov
8112e34210 cleanup 2015-11-17 09:59:49 +03:00
Dmitry Stogov
843c165735 Don't undo/redo "pass two" for jump targets in opcache optimizer. 2015-11-17 07:15:35 +03:00
Nikita Popov
e02aea5590 Remove no longer applicable optimization
PHP 7 generates CVs inside silenced blocks.
2015-11-14 11:23:31 +01:00
Dmitry Stogov
3a5fa926bf Squashed commit of the following:
commit afe963e6cc289696e60c6c679796ba2197c52b3b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 13 15:32:29 2015 +0300

    Added news entry

commit a126b891c97848dd7ef8f1abf716328c46e0f19c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 13 15:29:21 2015 +0300

    VERIFY_RETURN_TYPE doesn't have to cleanup operand on exception, bacause now, live temporary variables are released by exception unwinder.

commit 0db475e98786e6bcaa8401ee3e0b33743b9a2f2b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 12 22:55:39 2015 +0300

    Fixed copy/paste

commit 0ac73fe7174bec9de9a610319a98b259bea67f7f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 11 16:11:50 2015 +0300

    Fixed bug #62210 (Exceptions can leak temporary variables)
2015-11-13 15:35:07 +03:00
Dmitry Stogov
63c4414940 Initialize ctx->optimization_level 2015-11-12 02:46:41 +03:00
Dmitry Stogov
09aa68b294 Break dependency between opcache and optimizer. Remove copatibility macros. 2015-11-12 02:02:24 +03:00
Dmitry Stogov
948b7f5421 Changed ZEND_FREE.op2.num and ZEND_FE_FREE.op2.num back to use live_range_offset (try_catch_offset does't work) 2015-11-11 11:12:44 +03:00
Dmitry Stogov
baf97b1fcc We don't nees zend_op_array->brk_cont_array at run-time anymore.
Move zend_op_array->brk_cont_array into CG(context).brk_cont_array.
Use more compact zend_op_array->live_range instead of zend_op_array->brk_cont_array.
Semantic is kept unchanged.
2015-11-10 21:48:03 +03:00
Dmitry Stogov
86a96f2cf1 Changed meaning of "op2" for ZEND_FREE, ZEND_FE_FREE, ZEND_FAST_CALL, ZEND_FAST_RET.
Previously it was an instruction number.
Now it's an index in op_array->try_cacth_array[].
2015-11-10 19:13:54 +03:00
Nikita Popov
83b1679b6f Merge branch 'PHP-7.0'
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
2015-11-07 17:50:39 +01:00
Nikita Popov
bc3512c1d6 Fix various update_opN_const issues 2015-11-07 17:45:26 +01:00
Nikita Popov
9da456655c Refactor update_op2_const
Combines both switches into one, to avoid having to maintain the same
opcode list twice. This also makes most of the bugs fixed by the next
commit pretty obvious.

No functional change here.
2015-11-07 17:31:09 +01:00
Reeze Xia
568c81809a Merge branch 'PHP-7.0'
* PHP-7.0:
  C99 complain fix
  Update NEWS
  Fixed bug #70876 Segmentation fault when regenerating session id with strict mode
2015-11-07 22:17:10 +08:00
Reeze Xia
c524f43e4f C99 complain fix 2015-11-07 22:15:19 +08:00
Nikita Popov
603c172269 Merge branch 'PHP-7.0'
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
2015-11-07 12:09:20 +01:00
Nikita Popov
99d818f1e9 Don't propagate into ops that error on non-string
To properly support this make update_opN_const fallible -- they
are not always called through replace_with_const.
2015-11-07 12:04:51 +01:00
Nikita Popov
00b37e718d Strip leading backslash in update_opN_const 2015-11-07 12:04:51 +01:00
Nikita Popov
632bee4abb Fix update_opX_const lowercasing
It was lowering in-place.
2015-11-07 12:04:51 +01:00
Xinchen Hui
5385478844 Merge branch 'PHP-7.0' 2015-11-04 19:01:31 +08:00
Xinchen Hui
fe0af271c6 Fixed bug #70843 (Segmentation fault on MacOSX with opcache.file_cache_only=1) 2015-11-04 18:59:30 +08:00
Xinchen Hui
1af0118ff8 Merge branch 'PHP-7.0' 2015-10-26 17:29:22 -07:00
Xinchen Hui
008d8b6789 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:28:19 -07:00
Xinchen Hui
31553f07f2 Revert "Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use)"
This reverts commit 3ef96c2cc6.
2015-10-26 17:26:30 -07:00
Xinchen Hui
0771b46099 Merge branch 'PHP-7.0' 2015-10-26 17:11:16 -07:00
Dmitry Stogov
3e89c883bb Changed ZEND_CLONE->extended_value meaning to relative offset (previously it was absolute opline number) 2015-10-30 14:53:53 +03:00
Dmitry Stogov
4d702c21d0 Merge branch 'PHP-7.0'
* PHP-7.0:
  Don't remap .text segment if huge pages are not available.
2015-10-29 08:45:22 +03:00
Julien Pauli
eb59dd7d81 Don't remap .text segment if huge pages are not available. 2015-10-29 08:44:19 +03:00
Dmitry Stogov
da8e6ec4a5 Fixed incorrect instruction cleanup 2015-10-28 23:10:33 +03:00
Dmitry Stogov
3b44e40277 fixed incorrect bitmask 2015-10-28 21:26:52 +03:00
Dmitry Stogov
eb7be5379d Speed up fetching of class entries for self:: parent:: and static::
This is generalized solution for Bob's idea of speed up self::method() calls without ZEND_FETCH_CLASS.

At first, it adds few new opcodes to separate class related behaviour:
	FETCH_STATIC_PROP_R
	FETCH_STATIC_PROP_W
	FETCH_STATIC_PROP_RW
	FETCH_STATIC_PROP_FUNC_ARG
	FETCH_STATIC_PROP_UNSET
	FETCH_STATIC_PROP_IS
	UNSET_STATIC_PROP
	ISSET_ISEMPTY_STATIC_PROP
	FETCH_CLASS_CONSTANT

At seconds, it enables IS_UNUSED operand to fetch (self, parent or static without separate FETCH_CLASS) for new opcodes and the following ones:
	INIT_STATIC_METHOD_CALL
	NEW
	END_INSTANCEOF

Finaly, opcache optimizer had to be fixed to support new opcodes.
2015-10-28 21:26:52 +03:00
Xinchen Hui
3ef96c2cc6 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:09:42 -07:00
Xinchen Hui
d4df6641c8 Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10) 2015-10-17 01:52:32 -07:00
Anatol Belski
ffb5d0aca3 Implemented file_cache_fallback mechanism
which is essential as an attempt to fix the "failed to reattach"
error on Windows. If file_cache is enabled, Opcache will
automaticaly switch to file_cache_only mode in the case a process
failed to map the shared segment at the required address. The
important small part of the SHM will still be mapped, which
allows information exchange between normal processes using SHM
and those using the fallback mechanism.

This is based on Dmitry's, Matt's and mine ideas. So many thanks for
support!
2015-10-09 23:47:59 +02:00
Anatol Belski
a549a3ac17 improve error message 2015-10-04 16:36:53 +02:00