Commit graph

1805 commits

Author SHA1 Message Date
Dmitry Stogov
ee56552913 Disable "bad" optimisations only for emulation loop 2019-05-30 20:35:30 +03:00
Dmitry Stogov
b2cb6a4a27 Avoid double copying 2019-05-28 13:35:00 +03:00
Nikita Popov
fd23f9104a BIND_STATIC of implicit binding may be undef
Even though we don't need it at runtime, add the BIND_IMPLICIT
flag to BIND_STATIC as well, so we can distinguish this case in
type inference.

This fixes a JIT miscompile in arrow_functions/002.phpt.
2019-05-27 17:12:20 +02:00
CHU Zhaowei
e829d08729 Implement spread operator in arrays
RFC: https://wiki.php.net/rfc/spread_operator_for_array

Closes GH-3640.
2019-05-13 14:42:43 +02:00
Nikita Popov
f3e5bbe6f3 Implement arrow functions
Per RFC: https://wiki.php.net/rfc/arrow_functions_v2

Co-authored-by: Levi Morrison <levim@php.net>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2019-05-02 15:04:03 +02:00
Dmitry Stogov
38f9c8d93d Don't initialize return value before calling user functions 2019-04-18 02:31:12 +03:00
Dmitry Stogov
cb3cfc9ff8 Removed tests that always (or almost always) true 2019-04-15 13:18:16 +03:00
Nikita Popov
7f6c22cb3d Fix last maybe uninit warnings on 7.4
Most of these only occur under GCC 5. Not fond of all the workarounds
(especially the PDO one), but it gets us a clean build...
2019-04-15 11:35:13 +02:00
Dmitry Stogov
55cc280429 Backported call frame initialization improvement 2019-04-12 02:35:42 +03:00
Dmitry Stogov
88a2268d6b Replace "ZEND_CALL_CTOR" hack by additional live-range 2019-04-12 00:49:45 +03:00
Nikita Popov
30df87f77d Generate ZEND_COUNT for sizeof()
sizeof() is an alias of count(), so we should generate the same
code for them.
2019-04-11 10:48:52 +02:00
Nikita Popov
e86820eb56 Fix invalid function by-ref prop assign handling 2019-04-08 10:18:26 +02:00
Dmitry Stogov
d6848625d7 Optimized "smart branch" instructions 2019-04-05 00:25:45 +03:00
Dmitry Stogov
9038d5c6ee Make is_identical() functions return zend_bool (instead of int) 2019-04-04 18:18:12 +03:00
Dmitry Stogov
575c3576a7 unused variable 2019-04-04 17:52:17 +03:00
Dmitry Stogov
9cb926d8d1 Improved comparison opcode handlers 2019-04-02 23:46:21 +03:00
Dmitry Stogov
14359eb7eb Fixed typo 2019-03-20 01:31:35 +03:00
Dmitry Stogov
9357953bab micro-optimization 2019-03-19 02:02:14 +03:00
Dmitry Stogov
d4bef4ce7b Avoid useless code duplication, because of unused specialization 2019-02-15 17:49:39 +03:00
Dmitry Stogov
78a1d76962 Reduce slow code size 2019-02-15 17:03:04 +03:00
Nikita Popov
adf2f39745 Fix build without global regs 2019-02-14 14:01:39 +01:00
Dmitry Stogov
626bc3a2de More accurate handling of global registers (allow VM with single global register) 2019-02-12 17:39:02 +03:00
Nikita Popov
1a4ffcd2b4 Fix DIM_OBJ specialization in zend_vm_get_opcode_handler_func
DIM_OBJ also specializes over ASSIGN_STATIC_PROP nowadays.
2019-02-07 10:06:25 +01:00
Nikita Popov
340c6d3927 Revert "Don't silence fatal errors with @"
This reverts commit abd36289e2.

This wasn't ready for merging yet, there are still some test
failures.
2019-01-31 09:39:10 +01:00
Nikita Popov
abd36289e2
Don't silence fatal errors with @ 2019-01-31 07:11:05 +01:00
Zeev Suraski
a81202ac49 Adios, yearly copyright ranges 2019-01-30 11:48:28 +01:00
Nikita Popov
a50198d0fe Implement ??= operator
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator

$a ??= $b is $a ?? ($a = $b), with the difference that $a is only
evaluated once, to the degree that this is possible. In particular
in $a[foo()] ?? $b function foo() is only ever called once.
However, the variable access themselves will be reevaluated.
2019-01-22 11:12:04 +01:00
Dmitry Stogov
0941f25811 Removed useless Z_REFCOUNTED_P() checks. 2019-01-17 10:53:58 +03:00
Dmitry Stogov
8661b6dd5d Reduce slow code size 2019-01-16 14:26:32 +03:00
Dmitry Stogov
fd27fd4a15 Fixed and improved incorrect usage of value_type argument. 2019-01-16 11:06:19 +03:00
Dmitry Stogov
6a2d2af06a Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix param list for build without global reg
2019-01-16 02:30:15 +03:00
Dmitry Stogov
0b21a4ba45 Separated zend_assign_to_typed_prop() 2019-01-16 02:13:43 +03:00
Anatol Belski
cd43a4629f Fix param list for build without global reg 2019-01-15 22:31:52 +01:00
Dmitry Stogov
938ba93f4a Separated zend_binary_assign_op_typed_ref() and zend_binary_assign_op_typed_prop() helpers 2019-01-15 18:49:05 +03:00
Dmitry Stogov
239305d12e Fixed uninitialized result of PRE_INC/PRE_DEC in case of exception.
Separated increment/decrement of typed reference into helper.
2019-01-15 18:03:46 +03:00
Dmitry Stogov
7f053c2c49 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77263 (Segfault when using 2 RecursiveFilterIterator)
2019-01-14 13:21:03 +03:00
Dmitry Stogov
920450534e Fixed bug #77263 (Segfault when using 2 RecursiveFilterIterator) 2019-01-14 13:18:28 +03:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Nikita Popov
fe359cf1ff Fix undefined function error message
This got fixed on 7.3, but the implementation is slightly different
on master and the new test was failing.
2019-01-02 15:41:38 +01:00
Xinchen Hui
1a0c325b89 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77376 ("undefined function" message no longer includes namespace)
2019-01-02 15:32:29 +08:00
Xinchen Hui
e01f08f679 Fixed bug #77376 ("undefined function" message no longer includes namespace) 2019-01-02 15:32:17 +08:00
Dmitry Stogov
b8d6aac5ad Micro optimization 2018-12-28 15:34:33 +03:00
Dmitry Stogov
e8daada82e Tune ARRAY_KEY_EXISTS opcode handler for speed and code size 2018-12-27 02:34:52 +03:00
Dmitry Stogov
70fcbe3524 Fixed ext/spl/tests/bug61347.phpt failure introduced by ZEND_ARRAY_KEY_EXISTS opcode 2018-12-27 00:20:20 +03:00
Michael Moravec
f5044a12dd Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists() 2018-12-26 23:54:11 +03:00
Dmitry Stogov
d90a5d2e1a Micro optimization 2018-12-26 12:30:30 +03:00
Dmitry Stogov
a111dfae0b Removed dead condition 2018-12-25 19:23:40 +03:00
Dmitry Stogov
2954a309de Avoid code duplication 2018-12-25 17:48:29 +03:00
Dmitry Stogov
ae9e956ef9 Reorder conditions 2018-12-18 23:23:44 +03:00
Dmitry Stogov
868c1b7377 Reduce executor size 2018-12-18 17:34:18 +03:00