Commit graph

1993 commits

Author SHA1 Message Date
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Nikita Popov
c32da66e12
Remove --disable-opcache-filecache option
This is no longer an experimental feature, and we have the ability
to control this at runtime via an ini setting.
2019-02-07 12:07:25 +01:00
Dmitry Stogov
da919a8b65 Remove copyright years. 2019-02-05 10:33:28 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Joe Watkins
ed1afdd617
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:42:07 +01:00
Joe Watkins
e1c93d1fb2
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:41:26 +01:00
Tyson Andre
cf56832d00
Properly check for array_replace_recursive in sccp.c
Due to a typo, this code used to check for array_merge_recursive
twice.
2019-02-03 08:40:21 +01:00
David Carlier
6a8260a0ac opcache/FreeBSD huge code page pragma support
Sort of following up on super pages support earlier, here
we also detect page mappings possibly eligible to go to
super pages.
2019-01-30 12:01:44 +01:00
Dmitry Stogov
0ff71aead1 Fixed crash 2019-01-25 11:53:31 +03:00
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