1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00
Commit Graph

3054 Commits

Author SHA1 Message Date
Máté Kocsis 93640db4d5 Improve error message for deprecated methods 2020-05-14 17:23:31 +02:00
Dmitry Stogov 161ee110bf Tracing JIT support for delayed call chain 2020-05-14 14:21:46 +03:00
Dmitry Stogov 9122638ecd Set "hybrid_ret_counters" only after links to "function entry" traces. 2020-05-13 17:45:48 +03:00
Dmitry Stogov fa919f9277 Fixed JIT with ON_HOT_COUNTERS trigger (opcache.jit=1235) 2020-05-13 16:00:25 +03:00
Dmitry Stogov 98d8bcc13a Better trace_buffer packing 2020-05-13 15:45:42 +03:00
Xinchen Hui f06f260292 Revert "Fixed crash if jit.trigger is counter based with preload scripts"
This reverts commit 3d4e23aa92.
2020-05-13 18:35:00 +08:00
Xinchen Hui 3d4e23aa92 Fixed crash if jit.trigger is counter based with preload scripts 2020-05-13 18:22:29 +08:00
Xinchen Hui 91b5571fcc Fixed #79582 (Crash seen when opcache.jit=1235 and opcache.jit_debug=2) 2020-05-13 18:00:16 +08:00
Dmitry Stogov 7d66e4f323 Replace zend_jit_trace_info.loop_kind by zend_jit_trace_info.flags 2020-05-13 00:56:04 +03:00
Dmitry Stogov 25b7df4283 Fixed invalid index 2020-05-12 23:45:34 +03:00
Dmitry Stogov 2224f63bb5 Prevent usage of uninitialized class entry 2020-05-12 23:34:07 +03:00
Christoph M. Becker 3689807998 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79588: Boolean opcache settings ignore on/off values
2020-05-12 19:50:16 +02:00
Christoph M. Becker 129fd647a1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79588: Boolean opcache settings ignore on/off values
2020-05-12 19:48:12 +02:00
Christoph M. Becker 5bdb4ab786 Fix #79588: Boolean opcache settings ignore on/off values
We should display boolean INI settings as boolean.
2020-05-12 19:44:39 +02:00
Alex Dowad f0960879e4 zend_timeout is not a signal handler function
The 'int dummy' parameter to this function makes it appear that it was intended as a
signal handler, but it is not being used as such. So remove the redundant parameter.
2020-05-12 17:13:46 +02:00
Dmitry Stogov 650ab370c7 Avoid useless manual instruction encoding 2020-05-12 14:24:13 +03:00
Dmitry Stogov 60090adc6a Move EG(vm_interrupt) checks at the end of the trace loops 2020-05-12 13:35:38 +03:00
Dmitry Stogov 6e2cd97b43 cleanup 2020-05-08 10:07:55 +03:00
Dmitry Stogov c34d29db33 Change parameter meaning. 2020-05-08 01:24:02 +03:00
Dmitry Stogov dcedc31979 Use proper "cost" 2020-05-08 00:56:03 +03:00
Dmitry Stogov ef45d4d698 Avoid loop throgh side_exit from the first trace instruction. 2020-05-08 00:48:17 +03:00
Dmitry Stogov 5d9063a546 Fixed tracing JIT for CALL VM without global register variables 2020-05-07 23:41:48 +03:00
Dmitry Stogov 9af2f0fa78 More accurate tracing JIT for RETURN with unknown return address 2020-05-07 22:01:59 +03:00
Tyson Andre 9f8f84adbc Evaluate str_starts_with and str_ends_with on constants
When both arguments are strings,
this is guaranteed not to emit notices.

Closes GH-5539
2020-05-07 16:24:03 +02:00
Dmitry Stogov 98acdbff18 Prevent taking side traces for exceptional cases. Always exit to VM interpreter. 2020-05-07 12:49:01 +03:00
Dmitry Stogov 7977cd1c19 Fixed comment 2020-05-07 09:05:33 +03:00
Dmitry Stogov 9d869f24d4 Avoid Program Counter guard in side trace started from Fake Init Fcall guard. 2020-05-06 23:16:45 +03:00
Dmitry Stogov b63eff17ff Initial support for IS_INDIRECT. Avoid type guards for IS_INDIRECT. 2020-05-06 22:27:38 +03:00
Dmitry Stogov 776b1aefc8 Careful cleanup 2020-05-06 16:26:36 +03:00
Nikita Popov 5bc1e224db Make numeric operations on resources, arrays and objects type errors
RFC: https://wiki.php.net/rfc/arithmetic_operator_type_checks

Closes GH-5331.
2020-05-05 16:11:13 +02:00
Nikita Popov 4c24545aab Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79548
2020-05-04 16:30:34 +02:00
Nikita Popov 21a9ad910b Fixed bug #79548
When duplicating user functions with static variables, make sure
that we init a new map ptr slot for the static variables.
2020-05-04 16:27:45 +02:00
Nikita Popov f55b413d60 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79535
2020-05-04 14:52:42 +02:00
Nikita Popov 733d84dbdf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79535
2020-05-04 14:52:18 +02:00
Nikita Popov 7c1316ec6a Fixed bug #79535
We did not allocate a cache slot for FETCH_CLASS. This is already
fixed on newer PHP versions.
2020-05-04 14:51:18 +02:00
Tyson Andre d63eca285a Fix miscellaneous typos in code comments/var names
Closes GH-5501
2020-05-01 15:49:05 +02:00
Tyson Andre 54febdbc7d Fix other typos in param name/code comments
Closes GH-5502
2020-05-01 12:23:16 +02:00
Dmitry Stogov 968c31a43c Better handling of IS_UNDEF variables 2020-04-30 17:07:35 +03:00
Dmitry Stogov 3c04ce43ed Replace ZEND_ASSERT() by conditional compilation abort.
Prevent endless loop through ESCAPE code.
2020-04-30 15:32:01 +03:00
Nikita Popov 53eee290b6 Completely remove disabled functions from function table
Currently, disabling a function only replaces the internal
function handler with one that throws a warning, and a few
places in the engine special-case such functions, such as
function_exists. This leaves us with a Schrödinger's function,
which both does not exist (function_exists returns false) and
does exist (you cannot define a function with the same name).
In particular, this prevents the implementation of robust
polyfills, as reported in https://bugs.php.net/bug.php?id=79382:

    if (!function_exists('getallheaders')) {
        function getallheaders(...) { ... }
    }

If getallheaders() is a disabled function, this code will break.

This patch changes disable_functions to remove the functions from
the function table completely. For all intents and purposes, it
will look like the function does not exist.

This also renders two bits of PHP functionality obsolete and thus
deprecated:

 * ReflectionFunction::isDisabled(), as it will no longer be
   possible to construct the ReflectionFunction of a disabled
   function in the first place.
 * get_defined_functions() with $exclude_disabled=false, as
   get_defined_functions() now never returns disabled functions.

Fixed bug #79382.

Closes GH-5473.
2020-04-30 09:53:57 +02:00
Dmitry Stogov 65934d31d1 Improved tracing JIT for nested calls 2020-04-29 18:24:18 +03:00
Dmitry Stogov faa57abe71 white space fixes 2020-04-29 13:29:01 +03:00
Nikita Popov 17d763ff47 JIT: Save opline before calling zend_timeout
tests/045.phpt started segfaulting, because the opline is not set
when zend_timeout is invoked.
2020-04-29 10:58:39 +02:00
Nikita Popov 88a701aa02 Less conservative fix
I think it's reasonable to assume that the only possible types
are those that are declared, and null, because null is what
return_value is initialized to.
2020-04-28 15:55:02 +02:00
Nikita Popov 0da38cda6e Fix JIT segfaults in FFI tests
Conservative fix that just disables this optimization.
2020-04-28 15:43:52 +02:00
Dmitry Stogov 790a08c885 Improve JIT code for FCALL with "fake" INIT and avoid fcall_guard if possible. 2020-04-28 13:05:56 +03:00
Nikita Popov f38d6cea42 Check func_info consistency
Make sure explicitly specified func_info is a subset of
automatically computed info. This will at least prevent
cases where a type is removed from stubs, but not removed
from func_info.

Closes GH-5471.
2020-04-27 16:25:59 +02:00
Nikita Popov c5f87eee5d Mark passthru() as RC0
This function only returns null/false, RC1 does not make sense.
2020-04-27 15:39:31 +02:00
Nikita Popov 58eafbe734 Make array_rand() type info more accurate 2020-04-27 15:36:32 +02:00
Nikita Popov cc8a8613b6 Remove MAY_BE_FALSE from range() type info 2020-04-27 15:36:32 +02:00