Commit Graph

1532 Commits

Author SHA1 Message Date
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
ee56552913 Disable "bad" optimisations only for emulation loop 2019-05-30 20:35:30 +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
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
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
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
CrazyMiaoo
9df15fc26b Add gcc global register for aarch64 2019-04-22 14:29:30 +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
88a2268d6b Replace "ZEND_CALL_CTOR" hack by additional live-range 2019-04-12 00:49:45 +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
Markus Staab
87b62fe7bc
typo 2019-04-05 07:57:43 +02:00
Dmitry Stogov
d6848625d7 Optimized "smart branch" instructions 2019-04-05 00:25:45 +03:00
c9s
7c351ba65c Fix out-dated docs and typo
[ci skip]
2019-03-01 16:14:11 +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
Tyson Andre
da3316ff0f Fix typos in code comments in Zend/ [skip ci] 2019-02-18 17:56:28 +01:00
Nikita Popov
adf2f39745 Fix build without global regs 2019-02-14 14:01: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
626bc3a2de More accurate handling of global registers (allow VM with single global register) 2019-02-12 17:39:02 +03: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
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
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
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