Commit Graph

1748 Commits

Author SHA1 Message Date
Dmitry Stogov
ef05eab432 Improve zend_binary_assign_op helpers.
Reorder opcode numbers to make ADD-POW and ASSIGN_ADD-ASSIGN_POW opcodes sequencional.
2019-07-04 17:25:43 +03:00
Dmitry Stogov
c98b6d5bb5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Better optimization in RELEASE build. ZEND_ASSERT(s) prevented optimization
2019-07-03 20:24:26 +03:00
Dmitry Stogov
09041151de Better optimization in RELEASE build. ZEND_ASSERT(s) prevented optimization 2019-07-03 20:19:56 +03:00
Dmitry Stogov
6188a69b8a Merge branch 'PHP-7.4'
* PHP-7.4:
  Optimization of INC/DEC helpers
2019-07-03 10:50:14 +03:00
Dmitry Stogov
56b8b165f8 Optimization of INC/DEC helpers 2019-07-03 10:33:03 +03:00
Dmitry Stogov
afe6e00b6e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed build without global register variables
2019-07-02 11:03:46 +03:00
Dmitry Stogov
baa883d3fc Fixed build without global register variables 2019-07-02 11:03:22 +03:00
Dmitry Stogov
97b685f0c1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Separate slow code
2019-07-02 01:17:05 +03:00
Dmitry Stogov
cbbd473bdd Separate slow code 2019-07-02 01:16:34 +03:00
Dmitry Stogov
f393502e7f Merge branch 'PHP-7.4'
* PHP-7.4:
  Micro-optimization
2019-07-01 16:57:55 +03:00
Dmitry Stogov
f2b6b2eee8 Micro-optimization 2019-07-01 16:57:25 +03:00
Nikita Popov
d82b270fa4 Remove unused zend_verify_arg_type() function 2019-06-21 17:15:02 +02:00
Dmitry Stogov
53bcc2339c Merge branch 'PHP-7.4'
* PHP-7.4:
  Cleanup
2019-06-21 11:46:33 +03:00
Dmitry Stogov
e1e8e670df Cleanup 2019-06-21 11:43:17 +03:00
Nikita Popov
6aaab9adf7 Merge branch 'PHP-7.4' 2019-06-20 16:24:31 +02:00
Nikita Popov
eaafb69eea Change indexing scheme for symtable_cache
symtable_cache_ptr now points to the first unused symtable_cache
entry, rahter than the last used one. This avoids taking a pointer
to the minus first element of the array, which is UB. Instead we
take a pointer to the end plus one, which is not UB.
2019-06-20 16:21:39 +02:00
Nikita Popov
6ae9c10534 Merge branch 'PHP-7.4' 2019-06-19 16:36:29 +02:00
Nikita Popov
268b5fec8e Fixed bug #78182 2019-06-19 16:35:12 +02:00
Nikita Popov
4d90848d68 Don't verify arginfo types for internal functions
To avoid duplicate type checks. In debug builds arginfo is still
checked and will generate an assertions if the function doesn't
subsequently throw an exception.

Some test results change due to differences in zpp and arginfo
error messages.
2019-06-17 11:46:28 +02:00
Nikita Popov
be6c083f28 Allow null for weak scalar arg of internal func in arginfo
For parity with zpp.
2019-06-17 11:46:23 +02:00
Nikita Popov
af10245034 Merge branch 'PHP-7.4' 2019-06-13 09:38:19 +02:00
Nikita Popov
b64107531b Fixed bug #78151 2019-06-13 09:37:30 +02:00
Joe Watkins
f93cd21b52
Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "micro-optimization"

This micro optimization caused several bugs in at least Xdebug, while
i_init_func_execute_data is not exported, APIs that are exported call it
this makes their use awkward for no real gain.
2019-06-12 20:21:59 +02:00
Joe Watkins
175c7bf6fe
Revert "micro-optimization"
This reverts commit 374f769982.
2019-06-12 20:04:47 +02:00
Nikita Popov
eea206a06c Merge branch 'PHP-7.4' 2019-06-12 13:18:04 +02:00
Nikita Popov
080e2316cf Mark some operand fetching funs as ATTRIBUTE_UNUSED
Whether these are used depends on VM specialization.
2019-06-12 13:17:25 +02:00
Dmitry Stogov
2b5a3afead Merge branch 'PHP-7.4'
* PHP-7.4:
  micro-optimization
2019-06-10 16:43:36 +03:00
Dmitry Stogov
374f769982 micro-optimization 2019-06-10 16:43:20 +03:00
Nikita Popov
00d549d73d Merge branch 'PHP-7.4' 2019-06-06 14:56:58 +02:00
Nikita Popov
7780ba9660 Try to fix Windows build 2019-06-06 14:56:42 +02:00
Dmitry Stogov
dbd1ecd09f Merge branch 'PHP-7.4'
* PHP-7.4:
  Support for exceptions thrown during "Array to string conversion" error processing
  Reduce over-specialization for quite seldom instructions
2019-06-06 14:10:23 +03:00
Dmitry Stogov
a95014dc10 Reduce over-specialization for quite seldom instructions 2019-06-06 13:13:09 +03:00
Dmitry Stogov
e029cc4dd4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Cheaper checks for exceptions thrown from __toString()
2019-06-06 02:23:17 +03:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Dmitry Stogov
0a6a350371 Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable "bad" optimisations only for emulation loop
2019-05-30 20:43:17 +03:00
Dmitry Stogov
ee56552913 Disable "bad" optimisations only for emulation loop 2019-05-30 20:35:30 +03:00
Nikita Popov
45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Dmitry Stogov
207d928da8 Merge branch 'PHP-7.4'
* PHP-7.4:
  zend_assign_to_variable() optimization
2019-05-29 13:59:01 +03:00
Dmitry Stogov
b06f05bf47 zend_assign_to_variable() optimization 2019-05-29 13:58:37 +03:00
Dmitry Stogov
0d102515bf zend_do_fcall_overloaded() doesn't have to be exported 2019-05-29 10:32:30 +03:00
Dmitry Stogov
139da4b271 Merge branch 'PHP-7.4'
* PHP-7.4:
  Removed ability to compile PHP without EX(run_time_cache). ZEND_EX_USE_RUN_TIME_CACHE was always defined.
2019-05-15 11:07:51 +03:00
Dmitry Stogov
f9e8015847 Removed ability to compile PHP without EX(run_time_cache). ZEND_EX_USE_RUN_TIME_CACHE was always defined. 2019-05-15 11:06:26 +03:00
Peter Kokot
34bc920382 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused functions
2019-05-09 19:07:39 +02:00
Peter Kokot
ec518aef10 Remove unused functions
- _get_zval_ptr_cv_deref_BP_VAR_UNSET
- _get_zval_ptr_cv_deref_BP_VAR_IS
- _get_zval_ptr_cv_deref_BP_VAR_RW
- _get_zval_ptr_cv_deref_BP_VAR_W
2019-05-09 19:07:24 +02:00
Peter Kokot
a7bd736c2c Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unused functions
2019-05-08 22:02:49 +02:00
Peter Kokot
3c92b79ea0 Remove unused functions
- zend_mm_bitset_find_zero
- zend_mm_bitset_find_one
- zend_mm_bitset_find_zero_and_set
- zend_is_by_ref_func_arg_fetch
2019-05-08 22:02:39 +02:00
Dmitry Stogov
4d7df449d0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add gcc global register for aarch64
2019-04-22 14:29:58 +03:00
CrazyMiaoo
9df15fc26b Add gcc global register for aarch64 2019-04-22 14:29:30 +03:00
Dmitry Stogov
150c5e04e9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Removed tests that always (or almost always) true
2019-04-15 13:19:39 +03:00
Dmitry Stogov
cb3cfc9ff8 Removed tests that always (or almost always) true 2019-04-15 13:18:16 +03:00
Dmitry Stogov
55cc280429 Backported call frame initialization improvement 2019-04-12 02:35:42 +03:00
Dmitry Stogov
39505764ad Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace "ZEND_CALL_CTOR" hack by additional live-range
2019-04-12 01:01:47 +03:00
Dmitry Stogov
88a2268d6b Replace "ZEND_CALL_CTOR" hack by additional live-range 2019-04-12 00:49:45 +03:00
Dmitry Stogov
cc900edd77 Simplify call frame initialization 2019-04-11 02:08:32 +03:00
Dmitry Stogov
2a310b24d6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Repare SWITCH VM
2019-04-09 01:17:36 +03:00
Dmitry Stogov
fe0a0897ba Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Repare SWITCH VM
2019-04-09 01:17:10 +03:00
Joe Watkins
ade73c360c
Merge branch 'PHP-7.4'
* PHP-7.4:
  typo
2019-04-05 07:57:54 +02:00
Markus Staab
87b62fe7bc
typo 2019-04-05 07:57:43 +02:00
Dmitry Stogov
5b34c87d18 Merge branch 'PHP-7.4'
* PHP-7.4:
  Optimized "smart branch" instructions
2019-04-05 00:26:20 +03:00
Dmitry Stogov
d6848625d7 Optimized "smart branch" instructions 2019-04-05 00:25:45 +03:00
Nikita Popov
513b76794b Make zpp failures always throw, independent of strict_types
Previously zend_parse_parameters (and FastZPP) would handle invalid
arguments depending on strict_types: With strict_types=1, a TypeError
is thrown, with strict_types=0 a warning is thrown and (usually) NULL
is returned. Additionally, some functions (constructors always and
other methods sometimes) opt-it to throwing regardless of strict_types.

This commit changes zpp to always generate a TypeError exception in
PHP 8.
2019-03-11 11:32:20 +01:00
Nikita Popov
472f577679 Merge branch 'PHP-7.4'
[ci skip]
2019-03-01 16:14:20 +01:00
c9s
7c351ba65c Fix out-dated docs and typo
[ci skip]
2019-03-01 16:14:11 +01:00
Nikita Popov
dae056420d Merge branch 'PHP-7.4' 2019-02-20 12:12:27 +01:00
Nikita Popov
a92db42568 Use "modify" error message for FUNC_ARG fetch as well
Avoid differences based on whether a W or FUNC_ARG fetch is performed.
2019-02-20 11:54:22 +01:00
Peter Kokot
18295b396f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix typos in code comments in Zend/ [skip ci]
2019-02-18 17:56:38 +01:00
Tyson Andre
da3316ff0f Fix typos in code comments in Zend/ [skip ci] 2019-02-18 17:56:28 +01:00
Nikita Popov
faaf510fa4 Merge branch 'PHP-7.4' 2019-02-14 14:02:32 +01:00
Nikita Popov
adf2f39745 Fix build without global regs 2019-02-14 14:01:39 +01:00
Nikita Popov
924142fef0 Merge branch 'PHP-7.4' 2019-02-14 12:51:39 +01:00
David Walker
e63febb1c7 Fixed bug #75921
Ensure that the "creating default object from empty value" warning is
always thrown. Previously some cases were missing the warning, in
particular those going through FETCH_OBJ_W rather than a dedicated
opcode (like ASSIGN_OBJ).

One slightly unfortunate side-effect of this change is that something
like $a->b->c = 'd' will now generate two warnings rather than one
when $a is null (one for property b, one for property c).
2019-02-14 12:50:25 +01:00
Dmitry Stogov
e17667abd5 Merge branch 'PHP-7.4'
* PHP-7.4:
  More accurate handling of global registers (allow VM with single global register)
2019-02-12 17:39:55 +03: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
a302d11610 Don't silence fatal errors with @ 2019-02-11 16:17:55 +01:00
Nikita Popov
4f0abd8465 Merge branch 'PHP-7.4' 2019-02-08 12:44:19 +01:00
Nikita Popov
0d4471fd28 Fix double free if post inc of typed property throws
We either need to add an extra ref because the copy is used as the
retval, which is freed by HANDLE_EXCEPTION, or we need to undef it
(done here).
2019-02-08 12:43:11 +01:00
Dmitry Stogov
f45e0ce928 Remove ZEND_OVERLOADED_FUNCTION and corresponding call_method object handler 2019-02-07 21:05:46 +03:00
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +01: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
Nikita Popov
aad39879f2 Remove bareword fallback for constants
Access to undefined constants will now always result in an Error
exception being thrown.

This required quite a few test changes, because there were many
buggy tests that unintentionally used bareword fallback in combination
with error suppression.
2019-01-31 13:52:06 +01:00
Nikita Popov
3d39479f4d Remove support for case-insensitive constants
The only remaining case-insensitive constants are null, true and
false, which are handled explicitly.

In the future we may convert them from constants to reserved keywords.
2019-01-31 13:52:06 +01:00
Nikita Popov
9c5ab992ac Merge branch 'PHP-7.4' 2019-01-31 09:40:01 +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
Joe Watkins
839bdf12ee
Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't silence fatal errors with @
2019-01-31 07:11:18 +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
Zeev Suraski
02557f87bc Adios, yearly copyright ranges 2019-01-30 11:23:29 +02:00
Nikita Popov
6c73b50cf6 Remove static calls to non-static methods 2019-01-30 09:19:02 +01:00
Dmitry Stogov
c69d830d45 Micro-optimization 2019-01-18 12:43:42 +03:00
Dmitry Stogov
77db3d524e Optimize zend_handle_fetch_obj_flags() 2019-01-18 01:22:14 +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
0b21a4ba45 Separated zend_assign_to_typed_prop() 2019-01-16 02:13:43 +03:00
Dmitry Stogov
a5446cc01c Reuse zend_incdec_typed_ref() and separate zend_incdec_typed_prop() 2019-01-16 00:22:34 +03: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
6f6532d32b Use fastcall calling convention 2019-01-15 11:14:33 +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
Dmitry Stogov
e8daada82e Tune ARRAY_KEY_EXISTS opcode handler for speed and code size 2018-12-27 02:34:52 +03:00
Dmitry Stogov
95d8e05554 Merge branch 'PHP-7.3'
* PHP-7.3:
  Respect EG(vm_stack_page_size)
2018-12-26 13:10:02 +03:00
Dmitry Stogov
b45774eed0 Respect EG(vm_stack_page_size) 2018-12-26 13:09:32 +03:00
Dmitry Stogov
868c1b7377 Reduce executor size 2018-12-18 17:34:18 +03:00
Gabriel Caruso
cdd8368d6f Clean up unnecessary ternary expressions and simplify some returns
- Simplify conditions
- Use ZEND_HASH_APPLY_* instead of hard-coded booleans
- Use ZEND_NORMALIZE_BOOL
- Drop sign in favor of ZEND_NORMALIZE_BOOL
2018-12-03 01:22:14 +01:00
Dmitry Stogov
5f2817ad61 Avoid early reference check 2018-11-27 15:27:40 +03:00
Dmitry Stogov
93f7cbf29b fixed typo 2018-11-20 12:53:05 +03:00
Dmitry Stogov
a5a3d507d2 Optimization 2018-11-20 11:55:16 +03:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Dmitry Stogov
d57cd36e47 Immutable clases and op_arrays.
Squashed commit of the following:

commit cd0c36c3f9
Merge: 4740dabb84 ad6738e886
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:43:38 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove the "auto" encoding
      Fixed bug #77025
      Add vtbls for EUC-TW encoding

commit 4740dabb84
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 14:12:28 2018 +0300

    Reverted back ce->iterator_funcs_ptr. Initialize ce->iterator_funcs_ptr fields in immutable classes.

commit ad7a78b253
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:46:30 2018 +0300

    Added comment

commit 0276ea5187
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:42:43 2018 +0300

    Added type cast

commit c63fc5d5f1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:36:51 2018 +0300

    Moved static class members initialization into the proper place.

commit b945548e93
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:21:03 2018 +0300

    Removed redundand assertion

commit d5a4108840
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:19:13 2018 +0300

    Removed duplicate code

commit 8dadca8864
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 11:05:43 2018 +0300

    Hide offset encoding magic in ZEND_MAP_PTR_IS_OFFSET(), ZEND_MAP_PTR_OFFSET2PTR() and ZEND_MAP_PTR_PTR2OFFSET() macros.

commit 9ef07c88bd
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:48:29 2018 +0300

    typo

commit a06f0f3d3a
Merge: 94099586ec 3412345ffe
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Oct 17 10:47:07 2018 +0300

    Merge branch 'master' into immutable

    * master:
      Remove unused variable makefile_am_files
      Classify object handlers are required/optional
      Add support for getting SKIP_TAGSTART and SKIP_WHITE options
      Remove some obsolete config_vars.mk occurrences
      Remove bsd_converted from .gitignore
      Remove configuration parser and scanners ignores
      Remove obsolete buildconf.stamp from .gitignore
      [ci skip] Add magicdata.patch exception to .gitignore
      Remove outdated ext/spl/examples items from .gitignore
      Remove unused test.inc in ext/iconv/tests

commit 94099586ec
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Oct 15 23:34:01 2018 +0300

    Immutable clases and op_arrays
2018-10-17 15:52:50 +03:00
Nikita Popov
1cfbb21790 Classify object handlers are required/optional 2018-10-16 20:53:59 +02:00
Dmitry Stogov
9418144054 Added assertions 2018-10-03 12:31:47 +03:00
Nikita Popov
c5f108c66c Handle binary_op failure in overloaded assigns 2018-09-23 15:29:25 +02:00
Dmitry Stogov
b137441f0e Improve ZEND_VM_SMART_BRANCH() 2018-09-19 11:47:02 +03:00
Nikita Popov
dfa166e7ed Remove unused ZEND_FILE_LINE in i_zval_ptr_dtor 2018-09-16 17:16:26 +02:00
Dmitry Stogov
bc288c4723 Simplify __clone() visibility check (magic methods still don't respect ZEND_ACC_CHANGED). 2018-09-13 13:36:09 +03:00
Dmitry Stogov
1cc0d78c9b This increment is not necessary anymore. 2018-09-11 22:56:31 +03:00
Dmitry Stogov
3ced766da9 Removed duplicate code. zend_fetch_dimension_address_LIST_w() was a copy of zend_fetch_dimension_address_W(), ZEND_FETCH_LIST_W_SPEC_CV_... a copy of ZEND_FETCH_DIM_W_SPEC_CV_... 2018-07-30 10:53:39 +03:00
Xinchen Hui
a7746d10a5 Fixed bug #76667 (Segfault with divide-assign op and __get + __set) 2018-07-27 13:00:14 +08:00
Dmitry Stogov
ab8094c666 Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. 2018-07-26 12:58:07 +03:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
afc82e243c Micro-optimization 2018-07-23 10:52:00 +03:00
Dmitry Stogov
88dd38ee81 Reduce overhead of case-insensitive constants deprecation for "fast path" 2018-07-17 12:58:58 +03:00
Dmitry Stogov
70d0175a13 Fixed error messages. 2018-07-16 17:08:11 +03:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Xinchen Hui
9d1e9b73c5 rename ref_dtor_func to rc_dtor_func 2018-07-06 19:15:26 +08:00
Xinchen Hui
f9297387f4 Rename zval_dtor_func and ref_dotr_func 2018-07-06 18:47:30 +08:00
Xinchen Hui
e3355ac5ec Revert "Rename _zval_dtor_func to _ref_dtor_func"
This reverts commit a362ae6b12.
2018-07-06 18:37:45 +08:00
Xinchen Hui
a362ae6b12 Rename _zval_dtor_func to _ref_dtor_func 2018-07-06 18:32:27 +08:00
Dmitry Stogov
af341213f7 se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0) 2018-07-04 12:08:07 +03:00
Dmitry Stogov
177c7e3a72 Merge branch 'bug63217'
* bug63217:
  Another fix for bug #63217
  Partial revert of 30156d588c
2018-07-03 12:58:50 +03:00
Dmitry Stogov
3fd97a5b1f Better hot/cold code splitting 2018-07-03 11:07:39 +03:00
Dmitry Stogov
28b03f9605 Another fix for bug #63217 2018-07-03 01:09:58 +03:00
Dmitry Stogov
57af94c8b9 Partial revert of 30156d588c 2018-07-02 20:54:44 +03:00
Rudi Theunissen
30156d588c Fixed bug #63217
Don't automatically convert literal string keys to integers on
array access, as we may be dealing with an ArrayAccess object,
rather than a plain array.
2018-07-02 16:41:59 +02:00
Nikita Popov
7909d4532c Merge branch 'PHP-7.2' 2018-06-30 20:11:59 +02:00
Nikita Popov
0f1726e45d Merge branch 'PHP-7.1' into PHP-7.2 2018-06-30 20:11:39 +02:00
Nikita Popov
9b0df97a42 Fix handling of void return type on internal functions 2018-06-30 20:10:57 +02:00
Dmitry Stogov
d6ab163be8 cleanup 2018-06-29 12:35:14 +03:00
Dmitry Stogov
56450c6e65 Moved very rare exception check into a single place. 2018-06-27 13:34:15 +03:00
Xinchen Hui
3d8c82c353 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)

Conflicts:
	Zend/zend_vm_execute.h
2018-06-27 13:08:47 +08:00
Xinchen Hui
3521661bd1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler)

Conflicts:
	Zend/zend_execute.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2018-06-27 13:07:36 +08:00
Xinchen Hui
d1b1866a3a Fixed bug #76534 (PHP hangs on 'illegal string offset on string references with an error handler) 2018-06-27 13:05:11 +08:00
Dmitry Stogov
49a4e69584 Fixed ability to call plain functions through zend_call_method() 2018-06-25 23:01:21 +03:00
Dmitry Stogov
7f67513ca3 Lazy function copying from op_cache SHM into process memory 2018-06-25 19:53:58 +03:00
Nikita Popov
490a49d0bb Use COPY_DEREF for DIM_IS and LIST_R as well
Also add an upgrading note for the behavior change, not that we
expect anyone to be affected...
2018-06-25 14:23:06 +02:00
Nikita Popov
61d00a6cf3
Use COPY_DEREF instead of COPY_UNREF
This fixes the behavior when the storage location of the fetch is
modified before the operand is dereferenced by the using VM opcode.

Furthermore it elimiates references as a possible return value from
*_R opcodes, which will give us more opportunities for inferences,
in particular in regard to typed properties.
2018-06-25 11:23:59 +02:00
Nikita Popov
7498f0163b Fix handling of assign-ops on overloaded props with ref return
Assign-ops and incdec on overloaded properties are implemented
using a read_property followed by write_property. Previously, if
__get() returned by-reference, pre-incdec and assign-op
additionally also modified the reference, while post-incdec worked
correctly.

This change synchronizes the three code-paths to not modify the
reference. The pre-incdec implementation matches the post-incdec
implementation, the assign-op implementation uses a distinct
result operand.
2018-06-09 00:36:46 +02:00
Dmitry Stogov
b6a2ae3a5b Cleanup 2018-06-05 11:26:15 +03:00
Dmitry Stogov
655d249ac9 Eliminate some checks for zero character inside an inclue file name 2018-05-30 18:24:31 +03:00
Anatol Belski
6f4a01da21 Fix build without global registers 2018-05-28 20:44:58 +02:00
Dmitry Stogov
c9df8ac6c5 Separate common code into helper function 2018-05-28 18:11:43 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
David Carlier
112578fc35 Don't use optimize pragmas with clang 2018-03-23 19:05:51 +01:00
Xinchen Hui
6a59f3714a Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #76025 (Segfault while throwing exception in error_handler).
2018-02-28 18:07:15 +08:00
Xinchen Hui
858ebd9285 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76025 (Segfault while throwing exception in error_handler).
2018-02-28 18:06:49 +08:00
Xinchen Hui
d5c171311d Fixed bug #76025 (Segfault while throwing exception in error_handler). 2018-02-28 18:06:37 +08:00
Dmitry Stogov
6fb9e24218 Allow generation of VM map 2018-02-22 15:31:00 +03:00
Dmitry Stogov
d393199e13 Fixed compilation warnings 2018-02-22 11:33:26 +03:00
Dmitry Stogov
bd908f6145 Fixed build without global register variables 2018-02-22 11:00:29 +03:00
Dmitry Stogov
927748b271 Reorganize make_real_object() related code 2018-02-21 18:43:38 +03:00
Dmitry Stogov
ecb52b8b3b Move exceprional code into helper & zend_fetch_var_address_helper() micro-optimization. 2018-02-21 17:09:42 +03:00
Dmitry Stogov
7559b1c50c Move result address calculation from specialized handlers to less specialized helpers 2018-02-21 16:06:29 +03:00
Dmitry Stogov
9c0427cada Mark exceptional helpers as "cold" 2018-02-21 12:07:29 +03:00
Dmitry Stogov
e1b1cff48d Move exceptional code into helpers 2018-02-21 10:10:04 +03:00
Dmitry Stogov
a00286921e Move cold code, duplicated by specializer, into helper functions 2018-02-20 23:44:25 +03:00
Dmitry Stogov
b46f10b43f Fixed build without global register variables 2018-02-20 20:39:02 +03:00
Dmitry Stogov
8b7cdbaa49 Separate slow path with make_real_object() and related code into "cold" function. 2018-02-20 17:22:11 +03:00
Dmitry Stogov
cbf2d91911 Separate cold paths of ISSET_ISEMPTY_DIM_OBJ 2018-02-20 14:42:53 +03:00
Dmitry Stogov
a3afad5af0 Added tracer to collect frequency of opcode handler call chains 2018-02-19 16:50:24 +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
6fadb72c0b Move exceptional code into "cold" helpers 2018-02-16 02:45:31 +03:00
Dmitry Stogov
02aea893fb Use Z_TYPE_INFO_REFCOUNTED() macro 2018-02-15 21:54:49 +03: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
9a6100f9dd Break dependency between IS_TYPE_REFCOUNTED and ZEND_CALL_FREE_EXTRA_ARGS 2018-02-02 17:38:07 +03:00
Dmitry Stogov
1d7eab12e6 Avoid redundand mask extraction 2018-01-31 13:34:34 +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
Dmitry Stogov
1613b6a06b Expand SEPARATE_STRING() 2018-01-18 02:30:07 +03:00
Dmitry Stogov
25a44cb99e Eliminate duplication, increment_string() performs it anyway. 2018-01-17 20:09:28 +03:00
Dmitry Stogov
12c386f5b9 Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. (reapply 781e1573af, now it should be OK). 2018-01-11 22:15:45 +03:00
Dmitry Stogov
6ba10a03e7 Revert "Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse." (this patch is incomplete or wrong)
This reverts commit 781e1573af.
2018-01-11 17:27:26 +03:00
Dmitry Stogov
781e1573af Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. 2018-01-11 16:25:28 +03:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
6e4d18924b Combine READY_TO_DESTROY, EXTRACT_ZVAL_PTR and FREE_OP_VAR_PTR into single, better optimized, macro. 2017-12-26 16:50:34 +03:00
Dmitry Stogov
35b3fdfd0a Separate exceptional code into cold functions. 2017-12-22 16:35:52 +03:00
Dmitry Stogov
3aceab825a Manual loop optimizaton.
Cost of the loops body is still the same, but the loop headers are improved.
2017-12-14 03:39:22 +03:00
Dmitry Stogov
4d19bc2279 Disable some "bad" GCC optimizations 2017-12-14 03:25:20 +03:00
David Walker
6d4de4cf05 Implement list() reference assignments
Support list() reference assignments of the form:

    list(&$a, list(&$b, $c)) = $d;

RFC: https://wiki.php.net/rfc/list_reference_assignment
2017-12-09 13:39:52 +01:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Dmitry Stogov
d1d1aff4e5 Optimization of init_func_execute_data() 2017-12-06 02:53:30 +03:00
Nikita Popov
828d8e635b Fix ZEND_VM_SPEC=0 build 2017-11-24 23:06:01 +01:00
Nikita Popov
6b258197e8 Fix zend_fetch_dimension_const()
Pass IS_TMP_VAR instead of IS_CONST as operand type, as IS_CONST
requires additional guarantees that are not necessarily
satisfied by the caller.
2017-11-24 21:24:13 +01:00
Dmitry Stogov
ec2dde0c0b Introduced zend_hash_find_ex() that may avoid unnecessary hash value check. 2017-11-24 14:01:19 +03:00
Dmitry Stogov
6780c74619 Allowed modification of VM stack page size. Exported few functions. Green light for Fibers/Coroutines. 2017-11-22 15:36:09 +03:00