Commit graph

184 commits

Author SHA1 Message Date
Dmitry Stogov
89b3c9f647 Optimizer support for ZEND_IN_ARRAY 2017-05-24 23:37:35 +03:00
Dmitry Stogov
a151d614ba Added missing "successors_count" update. 2017-05-17 12:52:36 +03:00
Xinchen Hui
187f42149d Improve fix for #74456 2017-04-18 12:47:53 +08:00
Xinchen Hui
1837eea66d Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74456 (Segmentation error while running a script in CLI mode)
2017-04-17 20:26:57 +08:00
Xinchen Hui
d6315c2fbb Fixed bug #74456 (Segmentation error while running a script in CLI mode)
Instead of make update_op1_by_const supports FETCH_LIST(CASE), I think
disable it is more safe for 7.1
2017-04-17 20:24:39 +08:00
Nikita Popov
ad8652818a Implement jumptable optimization 2017-04-10 22:23:14 +02:00
Nikita Popov
d1a012b602 Support more than two successors in opcache CFG 2017-04-10 22:18:24 +02:00
Nikita Popov
eeb6cdf810 Merge branch 'PHP-7.1' 2017-04-10 22:12:05 +02:00
Nikita Popov
1df3099f2f Merge branch 'PHP-7.0' into PHP-7.1 2017-04-10 22:11:47 +02:00
Nikita Popov
6f950e83eb Fix JMPZ+JMP => NOP+JMP optimization 2017-04-10 22:09:34 +02:00
Nikita Popov
d6f70f0ee3 Disable block pass for large functions
(Backport of 7ea261685f to 7.0.)
2017-03-28 22:07:37 +02:00
Nikita Popov
d3aac6f810 Merge branch 'PHP-7.1' 2017-03-17 12:54:11 +01:00
Nikita Popov
7ea261685f Disable block pass for large functions
This is the last fix for bug #74250.
2017-03-17 12:49:20 +01:00
Xinchen Hui
330a7b62c3 Fixed bug #74152 (if statement says true to a null variable) 2017-02-23 12:33:17 +08:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Nikita Popov
683a0a0f6e Merge branch 'PHP-7.1' 2016-12-07 23:15:02 +01:00
Nikita Popov
60249f4390 Fix propagation of QM_ASSIGN into VERIFY_RETURN_TYPE
VERIFY_RETURN_TYPE uses different formats for the CONST/non-CONST
cases. If we progate a CONST operand into op1, op1 should be
moved to result.
2016-12-07 23:14:46 +01:00
Dmitry Stogov
9c1920d9e8 Revert "Fix memory leaks with FE_RESET upon empty iterator"
This reverts commit 00e516e575.
2016-12-02 11:58:36 +03:00
Bob Weinand
00e516e575 Fix memory leaks with FE_RESET upon empty iterator
Solved by manually freeing and jumping to the opcode *after* FE_FREE
2016-11-30 17:44:34 +01:00
Nikita Popov
739698c493 Merge branch 'PHP-7.1' 2016-11-10 22:28:42 +01:00
Nikita Popov
8106c01afc Fix block pass leaks 2016-11-10 22:28:32 +01:00
Nikita Popov
976d72a3bd Merge branch 'PHP-7.1' 2016-11-10 14:59:56 +01:00
Nikita Popov
3048428cf0 Don't elide undef var notice 2016-11-10 14:58:54 +01:00
Nikita Popov
4f76073b6d Set result of FREE to unused in block pass 2016-11-10 14:55:52 +01:00
Nikita Popov
9a0bb40670 Remove handling for defined() and strlen() in opcache
These are converted by the compiler into DEFINED and STRLEN, no
need to handle the function forms.
2016-09-09 17:11:25 +02:00
Nikita Popov
766264f8d2 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 16:02:59 +02:00
Nikita Popov
bbcf77c309 Fix some block_pass bugs 2016-09-09 15:58:36 +02: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
Dmitry Stogov
b66039db33 Fixed bug #72944 (Null pointer deref in zval_delref_p). 2016-08-29 12:02:50 +03:00
Dmitry Stogov
0da7c08e39 Prevent wrong optimization 2016-07-13 15:05:11 +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
35e7573a33 Merge branch 'PHP-7.0'
Conflicts:
	ext/opcache/Optimizer/block_pass.c
2016-05-05 00:01:56 +02:00
Nikita Popov
0691e7a8e1 Fix JMPZ, JMPZNZ_EX chain optimization
The result_type was not copied, resulting in a corrupted JMPZ_EX.
Fix can be verified by inspecting the opcodes of the following
function (it should not contain any _EX opcodes):

function test() {
    if ($a && $b) {
        echo "a";
    }

    if ($b || $c || $d) {
        echo "b";
    }
}

Conflicts:
	ext/opcache/Optimizer/block_pass.c
2016-05-05 00:00:56 +02:00
Nikita Popov
4a568dd7c9 Drop left-over debugging statement in block pass 2016-04-16 20:23:23 +02:00
Andrea Faulds
1e82ad8038 Warn about invalid strings in arithmetic
Squashed commit of the following:

commit e05d3b6732
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Mar 30 01:43:35 2016 +0100

    UPGRADING and NEWS

commit 6caf1d4585
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Mar 20 21:18:33 2016 +0000

    Fixes

commit 6dadb1b0ef
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 02:15:01 2016 +0000

    Add test for numeric string errors in assignment

commit bd5f04e8dd
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 23:53:05 2016 +0000

    Add test for numeric string errors

commit c72e92f16d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:28:33 2016 +0000

    Add test for scientific notation in integer operations

commit d94c08852d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:25:57 2016 +0000

    Disable optimiser evaluation for numeric string errors

commit 30ee954ed1
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:46:25 2016 +0000

    fixup

commit a6403b79e0
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 22:00:27 2016 +0000

    Do not convert error-causing numeric strings ahead-of-time

commit f9dc354014
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 19:15:38 2016 +0000

    Disable compile-time evaluation for numeric string errors

commit e05b0cc849
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Feb 5 11:42:26 2016 +0000

    Make _zval_get_long_func_noisy function for inlining

commit 84d66321a5
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:10:00 2016 +0000

    Update tests

commit 5ac4a0cc4b
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 22:08:19 2016 +0000

    Use is_numeric_string_ex for zval_get_long etc.

commit c21f088485
Author: Andrea Faulds <ajf@ajf.me>
Date:   Thu Jan 7 21:13:04 2016 +0000

    Update tests

commit 63e214cf81
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Jan 6 00:28:01 2016 +0000

    Warn on non-/bad numeric strings in arithmetic
2016-03-30 01:44:27 +01: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
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
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
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