1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Commit Graph

64 Commits

Author SHA1 Message Date
Dmitry Stogov aa9c76d027 Fixed dump of constant flags 2019-05-22 22:59:40 +03:00
Zeev Suraski 9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Dmitry Stogov 9e0f131d2b Fixed ISSET/ISEMPTY bit meaning to simplify run-time checks 2018-05-31 19:02:51 +03:00
Nikita Popov b0af9ac733 Avoid live range references in opcodes
Don't store the live range of the freed variable for FREE_ON_RETURN
frees, instead look it up at runtime. As this is an extremely
unlikely codepath (in particular, it requires a loop variable with
a throwing destructor), saving the runtime lookup of the live range
is not worth the extra complexity this adds everywhere else.
2018-02-16 21:30:48 +01:00
Dmitry Stogov ca035f26aa Moved "zval.u2.cache_slot" into free room of "zend_op" 2018-02-05 19:41:47 +03:00
Dmitry Stogov 3a794d39f0 Avoid repeatable ARG_SHOULD_BE_SENT_BY_REF() checks in FETCH_*FUNC_ARG and following SEND_VAR_EX. Perform the check once in a new CHECK_FUNC_ARG opcode and reuse in the following FETCH_*FUNC_ARG and SEND_FUNC_ARG (SEND_VAR_EX replacement). 2018-02-05 19:40:06 +03:00
Dmitry Stogov 8c977c3430 typo 2018-02-01 17:46:30 +03:00
Dmitry Stogov ba298725d1 Changed CATCH instruction format (extended_value moved into op2, op2 into result, result into extended_value) 2018-01-31 22:39:30 +03:00
Dmitry Stogov 9c7fb529ce Changed FETCH_CONSTANT instruction format (extended_value moved into op1) 2018-01-31 18:15:25 +03:00
Dmitry Stogov f67f455ef7 Changed FETCH_CLASS instruction format (extended_value moved into op1) 2018-01-31 18:14:43 +03:00
Dmitry Stogov 7141631cc8 Change FETCH/ISSET instruction modifiers:
- Get rid of ZEND_ISEMPTY and ZEND_ISSET_ISEMPTY_MASK. Use just single ZEND_ISSET bit to make distinct between isset() and empty()
- Use ZEND_FETCH_GLOBAL, ZEND_FETCH_LOCAL and ZEND_FETCH_GLOBAL_LOCK as bitmask
- Removed unused ZEND_FETCH_STANDARD
- Extended ZEND_FETCH_ARG_MASK
2018-01-30 22:06:05 +03:00
Xinchen Hui a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov 33b094479b TYPE_CHECK instruction changed. Now it keeps in extended_value a type mask.
This makes check for "boolean" cheaper and allows check combination e.g. (is_string($a) || is_null($a))
2017-11-23 15:58:34 +03:00
Xinchen Hui d042d1d8e0 Cleanup cfg flags & Added ZEND_FUNC_HAS_EXTENED_INFO 2017-10-18 17:03:07 +08:00
Dmitry Stogov ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Rasmus Lerdorf 9fe6b29356 Add line numbers to Opcache's zend_dump_op() debug output 2017-10-06 11:03:07 -03:00
Dmitry Stogov e70618aff6 Changed the way VM accesses constant operands in 64-bit builds. 2017-10-04 16:53:01 +03:00
Xinchen Hui 95272f0b4a Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75267 (possible &/&& mixup)
2017-09-29 11:18:13 +08:00
Xinchen Hui d3aa65231e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75267 (possible &/&& mixup)
2017-09-29 11:17:07 +08:00
Xinchen Hui 9fd33c1f20 Fixed bug #75267 (possible &/&& mixup) 2017-09-29 11:16:32 +08:00
Dmitry Stogov b7d683c531 Added debug output 2017-09-13 23:59:16 +03:00
Dmitry Stogov 3cb6407e86 Initial implementation of Escape Analysis (disabled yet). 2017-08-22 16:55:03 +03:00
Dmitry Stogov 1180d8c801 Separate ISSET_ISEMPTY_CV/UNSET_CV from ISSET_ISEMPTY_VAR/UNSET_VAR 2017-07-17 14:11:50 +03:00
Nikita Popov ad8652818a Implement jumptable optimization 2017-04-10 22:23:14 +02: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
Dmitry Stogov 565ce0d41d Fixed typo 2016-10-20 01:17:40 +03:00
Dmitry Stogov 94fbcbe172 Allow optional splitting of basic blocks at RECV/RECV_INIT opcodes. 2016-08-29 20:35:17 +03:00
Dmitry Stogov 1433162083 Fixed compilation warnings 2016-06-21 20:12:29 +03:00
Nikita Popov 046889518d Add support for "instanceof" pi nodes 2016-06-13 19:03:59 +02:00
Nikita Popov 9877d8f019 Use union for pi constraints
This will make it easier to extend pi constraints without impacting
structure sizes.
2016-06-13 19:03:57 +02:00
Dmitry Stogov b111da96d9 Split ZEND_SEND_VAR_NO_REF into ZEND_SEND_VAR_NO_REF and ZEND_SEND_VAR_NO_REF_EX (similar to ZEND_SEND_VAL) and remove ZEND_ARG_* flags. 2016-05-31 04:06:00 +03:00
Dmitry Stogov 2ae21abdf7 Fixed bug #72213 (Finally leaks on nested exceptions).
Squashed commit of the following:

commit 8461b0407f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed May 25 00:34:42 2016 +0300

    Rmoved zend_try_catch_element.parent and walk through op_array.try_catch_array backward from the current try_cacth_offset.

commit 0c71e24964
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed May 25 00:04:53 2016 +0300

    Move SAVE_OPLINE() to its original place

commit 111432a4df
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed May 25 00:01:10 2016 +0300

    Separate the common part of ZEND_HANDLE_EXCEPTION and FAST_RET into zend_dispatch_try_catch_finally_helper.

commit 4f21c06c2e
Author: Nikita Popov <nikic@php.net>
Date:   Tue May 24 14:55:27 2016 +0200

    Improve finally fix

commit da5c727499
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 10:36:08 2016 +0300

    Fixed Zend/tests/try/bug70228_3.phpt and Zend/tests/try/bug70228_4.phpt

commit cfcedf2fb4
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 02:59:27 2016 +0300

    Added test

commit 4c6aa93d43
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 00:38:20 2016 +0300

    Added tests

commit 8a8f4704b0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon May 23 23:27:34 2016 +0300

    Fixed bug #72213 (Finally leaks on nested exceptions)
2016-05-25 01:25:12 +03: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
Nikita Popov a5944f8dd5 Merge def and gen sets
For live-variable analysis it does not matter if def includes
variables that are previously use in the same block, the data flow
equations still have the same result. As such there is no need to
compute separate gen & def sets.

I'm keeping the name "def", because use of "gen" in this context is
pretty confusing (gen is usually the use set, not the def set).
2016-04-21 23:32:01 +02: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
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
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 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 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
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
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
Dmitry Stogov dd3cb33ef0 Support for incompletely constructed SSA 2015-12-23 03:20:28 +03:00