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

353 Commits

Author SHA1 Message Date
Dmitry Stogov c1887974cc Setup RETURN counters for nested frames 2020-06-10 08:10:27 +03:00
Dmitry Stogov e9f295ac84 Tracing JIT support for megamorphic calls 2020-06-09 23:33:22 +03:00
Christoph M. Becker 4edce91fae Avoid unnecessary linking of Windows DLLs
For snapshot builds (`--enable-snapshot-build`), after the build has
been completely finished, running `nmake` causes a lot of DLLs to be
rebuilt.  The problem is that the build folders OptimizerObj and
opcache_jit are dependencies of the main PHP DLL, but these folders do
not exists in the source tree, so nmake assumes it has to re-link the
main PHP DLL, and that makes several other DLLs stale.

We solve that by mirroring the folder structure of the respective
source folders.
2020-06-09 18:37:37 +02:00
Javier Eguiluz 066a378316 [ci skip] Fixed some minor typos in code comments 2020-06-09 17:17:55 +02:00
Dmitry Stogov 797c1c5088 Tracing JIT support for real dynamic calls 2020-06-09 14:02:02 +03:00
twosee 83a77015ad Add helper APIs for maybe-interned string creation
Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.

Add zend_string_init_fast() as a helper for the empty string /
one char interned string / zend_string_init() pattern.

Also add corresponding ZVAL_STRINGL_FAST etc macros.

Closes GH-5684.
2020-06-08 15:31:52 +02:00
Dmitry Stogov 13909e5555 Fixed incorrect zend_bool type usage 2020-06-08 12:18:05 +03:00
Christoph M. Becker 5a04796f76 Fix MSVC level 1 (severe) warnings
We fix (hopefully) all instances of:

* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312>

`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.

We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.

[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
2020-06-05 11:17:05 +02:00
Dmitry Stogov bc37fc57e5 Avoid useless "mov" 2020-06-05 00:05:12 +03:00
Dmitry Stogov 58801f7142 Add guard for FETCH_DIM_FUNC_ARG 2020-06-04 14:04:21 +03:00
Dmitry Stogov 8047c1d05c Prefer shorter x86 instructions 2020-06-04 13:19:42 +03:00
Dmitry Stogov efde51e197 Improved tracing JIT for FETCH_OBJ_R/IS 2020-06-04 12:23:27 +03:00
Dmitry Stogov 2745053799 Tracing JIT for FETCH_DIM_FUNC_ARG and FETCH_OBJ_FUNC_ARG when they are used in READ mode (to pass by value). 2020-06-04 10:03:15 +03:00
Dmitry Stogov c59edf0ad5 Fixed abstract stack consistency for JMPZ_EX/JMPNZ_EX 2020-06-04 00:17:13 +03:00
Dmitry Stogov 3fae143318 "call_info" doesn't matter 2020-06-03 22:50:40 +03:00
Dmitry Stogov 0badfc0880 Avoid useless register reload 2020-06-03 18:14:51 +03:00
Dmitry Stogov 3587fc5418 Avoid useless REFCOUNTED check 2020-06-03 12:11:39 +03:00
Dmitry Stogov 72d1c50572 Use cheaper zend_rethrow_exception() instead of zend_throw_exception_internal() 2020-06-03 11:51:04 +03:00
Dmitry Stogov c93c3b4f0e Handle VM interrupts after DO_ICALL through side exits 2020-06-03 10:58:17 +03:00
Dmitry Stogov d237989f33 Avoid reference counting when RETURN CV 2020-06-03 00:49:10 +03:00
Dmitry Stogov 38f9d95ffa Added missed helper 2020-06-02 23:50:32 +03:00
Dmitry Stogov f733047ae2 Tracing JIT support for indirect CV modification (may be incomplete) 2020-06-02 15:55:18 +03:00
Dmitry Stogov 99053228b9 Afdded misse MAY_BE_ARRAY_* flags 2020-06-02 15:54:44 +03:00
Dmitry Stogov 2706615418 Fixed retutn type inference when return undefined variable 2020-06-01 16:26:22 +03:00
Dmitry Stogov b0613d16d7 Fixed tracing JIT for closure run_time_cache access 2020-06-01 12:06:26 +03:00
Nikita Popov ec3ee1f173 Fix Windows build 2020-05-29 12:58:31 +02:00
Dmitry Stogov 8e8c5a73ee Fixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002.phpt) 2020-05-29 13:27:47 +03:00
Dmitry Stogov dc7a0fb236 Allow tracing JIT generate code when function exits from VM (e.g. for magic __get/__set) 2020-05-29 13:25:59 +03:00
Dmitry Stogov 7aa8c7e6aa Don't add guards that are not going to be checked 2020-05-29 12:17:09 +03:00
Dmitry Stogov de7a0df0a2 Fixed use-after-free in tracing JIT when recording closures and top-level op_arrays. 2020-05-29 00:45:28 +03:00
Dmitry Stogov 784f1b5c49 Fixed tracing JIT type inference for passing undefined CV by value 2020-05-28 18:35:32 +03:00
Dmitry Stogov 0abe742d72 Fixed incorrect trace type inference for top-level code 2020-05-28 17:43:29 +03:00
Dmitry Stogov c16dbed0c4 Avoid recording of uninitialized types.
VM doesn't set Z_TYPE() for IS_VAR when passes class_entry reference.
2020-05-28 14:39:41 +03:00
Dmitry Stogov efbe96166d Split "opcache.jit_max_recursion_unroll" into "opcache.jit_max_recursive_calls" and "opcache.jit_max_recursive_returns".
It's possible to disable recording of "recursive return loops" setting opcache.jit_max_recursive_returns to 0.
2020-05-28 12:28:05 +03:00
Dmitry Stogov 501a2e86e8 Add a side exit on enter to function if it may be called with different number of arguments. 2020-05-28 01:22:32 +03:00
Dmitry Stogov d2d5738b32 Fixed tracing JIT support for ZEND_RETURN_BY_REF in CALL VM 2020-05-27 18:04:16 +03:00
Dmitry Stogov 0bf2bfcf8d Fixed tracing JIT for CALL VM 2020-05-27 17:05:06 +03:00
Dmitry Stogov 645ff9c8f6 Revert "Fixed tracing JIT for CALL VM"
This reverts commit 7f3a296f84.
2020-05-27 17:04:31 +03:00
Dmitry Stogov 7f3a296f84 Fixed tracing JIT for CALL VM 2020-05-27 15:59:29 +03:00
Dmitry Stogov f91283fcd4 Fixed JIT for ext/opcache/tests/bool_not_cv.phpt with opcache.jit=1202 2020-05-27 10:57:33 +03:00
Dmitry Stogov 6e5247275a Fixed JIT for ext/opcache/tests/jit/cmp_004.phpt with opcache.jit=1201 2020-05-27 09:59:12 +03:00
Dmitry Stogov d2f811438e Set proper jit_extension for inherited methods 2020-05-27 09:58:03 +03:00
Máté Kocsis 0de3ca4f98 Let's try to fix the JIT compiler warning 2020-05-26 20:56:29 +02:00
Christoph M. Becker 38c85efe83 Fix picky builds
Due to `-Werror=maybe-uninitialized` a bogus warning may be thrown, so
we initialize the variable to work-around that.
2020-05-26 18:37:29 +02:00
Dmitry Stogov 15aa891c5e Fixed JIT for integer overflow checks 2020-05-26 17:59:15 +03:00
Dmitry Stogov 59e69eb1c9 Fixed JIT for (LONG_MIN % -1) 2020-05-26 14:49:29 +03:00
Dmitry Stogov cf3b133a86 Fixed JIT for SEND_VAR $undefined_cv 2020-05-26 10:13:57 +03:00
Nikita Popov ca358001b9 Revert "Fixed JIT for SEND_VAR $undefined_cv"
This reverts commit d60988257b.

This change causes segfaults in many tests.
2020-05-25 23:51:11 +02:00
Dmitry Stogov 0386cbb95c Fixed tracing JIT for RETRUN $undefined_cv 2020-05-25 22:19:13 +03:00
Dmitry Stogov d60988257b Fixed JIT for SEND_VAR $undefined_cv 2020-05-25 18:24:50 +03:00