1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Commit Graph

1984 Commits

Author SHA1 Message Date
Dmitry Stogov 4887896e21 Fixed crash 2019-01-24 18:00:45 +03:00
Nikita Popov d3e5a2487f Merge branch 'PHP-7.3' 2019-01-22 12:28:44 +01:00
Nikita Popov 76760901fa Fixed bug #77287
There may be an EXT_NOP opcode before the parameter list, we should
skip over it.
2019-01-22 12:15:06 +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 8cb1ae92e6 Use SSA instead of bogus reverse linear scan. 2019-01-22 01:33:35 +03:00
Dmitry Stogov 6c983c6221 Use ZEND_FUNC_FREE_LOOP_VAR flag to avoid useless iterations. 2019-01-21 22:18:07 +03:00
Dmitry Stogov abd0651020 Avoid double live ranges recalculation. 2019-01-21 18:17:10 +03:00
Dmitry Stogov 97ccafd4c6 Live ranges construction optimization 2019-01-21 17:25:24 +03:00
Nikita Popov 3269e88468 Implement single-pass live range calculation
Instead of interleaving creation of live-ranges with the main
compiler code, compute them in a separate pass over the opcodes
as part of pass_two. Additionally, do not keep live ranges
synchronized during optimization in opcache and instead use the
same mechanism to recompute them after optimization.
2019-01-21 11:47:27 +01:00
Dmitry Stogov 2f89baf5c7 Fixed 32/64-bit mismatch 2019-01-14 13:15:52 +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 42cd5db142 Merge branch 'PHP-7.3' 2019-01-11 10:29:45 +01:00
Nikita Popov e6eac08abd Merge branch 'PHP-7.2' into PHP-7.3 2019-01-11 10:29:34 +01:00
Kevin Adler 332b58f865 Fix bug #77361 (configure fails on 64-bit AIX when opcache enabled)
In f904830012, support for GNU Hurd was added to the opcache and
the configure check to ensure the opcache knows the flock struct
layout prior to building was changed check for two cases: BSD layout
and Linux layout. All the existing hard-coded cases in
ZendAccelerator.h follow these two cases, except for 64-bit AIX.
This means that even though building on 64-bit AIX would work,
the configure script refuses to continue.

Add a new configure check for the 64-bit AIX case and a new
compiler definition HAVE_FLOCK_AIX64. Now that all the cases are
covered, simplify the ifdef logic around these three HAVE_FLOCK_*
macros:
- The macOS and the various BSD flavors fall under HAVE_FLOCK_BSD
- Linux, HP-UX, GNU Hurd, 32-bit AIX, and SVR4 environments
  fall under HAVE_FLOCK_LINUX
- 64-bit AIX falls under HAVE_FLOCK_AIX64

The only difference between the existing HAVE_FLOCK_LINUX and
the hard-coded Linux/HP-UX/Hurd case is that the latter
initialized the 5th member to 0, but since the C standard already
says that un-initialized members will be initialized to 0,
it's effectively the same.
2019-01-11 10:21:02 +01:00
Nikita Popov 61b0122698 Merge branch 'PHP-7.3' 2019-01-10 10:27:57 +01:00
Nikita Popov ade702a0d2 Fixed bug #77434
Mark arrays containing partial arrays as partial. This was already
done for the ADD_ARRAY_ELEMENT case, but not for ASSIGN_DIM.
2019-01-10 10:25:55 +01:00
Xinchen Hui b1a4f90ea9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Incase of invalid read
2019-01-10 14:53:36 +08:00
Xinchen Hui 16176ad0e3 Incase of invalid read 2019-01-10 14:50:39 +08:00
jvoisin fbdaabba62 Fix some sign-related issues in comparisons 2019-01-09 10:01:12 +01:00
Nikita Popov a22881520c Merge branch 'PHP-7.3' 2019-01-09 09:28:04 +01:00
Nikita Popov bf4dab0163 Make operator swapping depend on IGNORE_OVERLOADING flag
Add MUL back to the list and instead make the entire optimization
depend on IGNORE_OVERLOADING, which is there exactly so we can make
these kinds of assumptions.
2019-01-09 09:27:56 +01:00
Xinchen Hui dd61845cf8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77266 (Assertion failed in dce_live_ranges)
2019-01-08 19:19:44 +08:00
Xinchen Hui cd49db9d47 Fixed bug #77266 (Assertion failed in dce_live_ranges) 2019-01-08 19:19:01 +08:00
Nikita Popov c8a5deaddd Merge branch 'PHP-7.3' 2019-01-08 09:38:11 +01:00
Nikita Popov 7f8cab2535 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-08 09:38:02 +01:00
Nikita Popov 1165a9068c Don't swap operands of ZEND_MUL
If this is used with operator overloading, then the operation does
not necessarily commute (for example, matrix multiplication).
2019-01-08 09:37:49 +01:00
Nikita Popov 767cbd93c9 Merge branch 'PHP-7.3' 2019-01-07 10:05:33 +01:00
Nikita Popov 6f75890e7b Fix one issue reported in bug #77310
SCCP did not handle array ASSIGN_* with a BOT operand correctly.
2019-01-07 10:05:23 +01:00
Nikita Popov 31375c5ca3 Merge branch 'PHP-7.3' 2019-01-02 14:14:07 +01:00
Nikita Popov 325a113974 Possible fix for bug #77287
The cache size could be off by 4, if we're on a 32-bit system and
the slot had to be bumped for alignment reasons.

I wasn't able to reproduce the issue reported in bug #77287, but I
think this might be the cause.
2019-01-02 14:12:58 +01:00
Nikita Popov 685307b081 Merge branch 'PHP-7.3' 2019-01-02 09:32:59 +01:00
Nikita Popov 91888cc372 Fixed bug #77257
Correctly handle the case of duplicate predecessors, by removing the
duplicate predecessor and corresponding phi node operands.

For the future, it would be better to instead allow duplicate
predecessors and avoid this kind of fragile code...
2019-01-02 09:31:50 +01:00
Dmitry Stogov 76d8f3923e Revert HASH_FLAG_INITIALIZED into HASH_FLAG_UNINITIALIZED. 2018-12-28 11:22:18 +03:00
Dmitry Stogov 9bf80ef385 Respect static method visibility 2018-12-27 10:42:52 +03:00
Nikita Popov 0bbfebb6d9 Add SCCP support for ZEND_ARRAY_KEY_EXISTS 2018-12-26 23:54:11 +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 cec091176c Replace zend_hash_apply... with ZEND_HASH_FOREACH... 2018-12-19 02:49:56 +03:00
Nikita Popov da1e6679b7 CFG construction: Avoid code duplication
These code for those two cases is the same nowadays, so merge them.
2018-12-17 11:29:23 +01:00
Anatol Belski 282581ee8c Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove BOM
2018-12-11 00:39:55 +01:00
Anatol Belski 7dc1c7f630 Remove BOM 2018-12-11 00:38:54 +01:00
Nikita Popov 6debea2fd8 Merge branch 'PHP-7.3' 2018-12-10 13:36:54 +01:00
Nikita Popov 93aabf1533 Fixed bug #77275
Instead of juggling with this problem during literal compaction,
make sure that we always initialize Z_EXTRA for literals, which
seems like the more robust solution.
2018-12-10 13:36:23 +01:00
Nikita Popov 59cacdcefd Fix typos in compact literals debugging code 2018-12-10 13:35:55 +01:00
Dmitry Stogov 4f26b3b51b Mark preloaded op_arrays 2018-12-03 16:57:27 +03:00
Nikita Popov 745e250a21 Merge branch 'PHP-7.3' 2018-11-28 20:10:32 +01:00
Nikita Popov f4eec70260 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-28 20:10:17 +01:00
Nikita Popov 17f8b9fb36 Fixed bug #77215
Remove invalid assertion: A block can have multiple switch frees,
so if we don't do live range block splitting, it is not necessarily
true that the free is located at the start of a block.
2018-11-28 20:08:39 +01:00
Dmitry Stogov 23d3deb8be Added ZEND_COMPILE_WITHOUT_EXECUTION and ZEND_COMPILE_PRELOAD to determine when PHP compiler is invoked by opcache_compile_file() or preloading. 2018-11-27 11:52:53 +03:00
Dmitry Stogov 48b9594227 Don't preload functions and classes declared outside of preloaded scripts (e.g. by eval code). 2018-11-23 03:59:47 +03:00
Dmitry Stogov b076a91c50 Refactored script creation and classes/functions copying. 2018-11-23 03:19:16 +03:00