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

3170 Commits

Author SHA1 Message Date
Máté Kocsis b516566b84 Convert CURL resources to objects
Closes GH-5402

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-06-17 16:11:57 +02:00
Dmitry Stogov 18347758d7 Improved JIT for SEPARATE_ARRAY 2020-06-17 14:45:25 +03:00
Dmitry Stogov 3830855a65 Tracing JIT support for PHP references in ASSIGN instruction 2020-06-17 12:24:51 +03:00
Dmitry Stogov 93aaf68088 cleanup 2020-06-17 10:32:53 +03:00
Christoph M. Becker 92c4b06513 Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)
Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds.  This may be useful for other compilers as well.

[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
2020-06-16 18:39:09 +02:00
Dmitry Stogov 9ff3230c20 Merge exit points 2020-06-16 19:20:08 +03:00
Dmitry Stogov 626ccc45e4 Eliminate a dead check 2020-06-16 19:05:35 +03:00
Dmitry Stogov 8425214c1d Tracing JIT support for PHP references in array related instructions 2020-06-16 17:59:04 +03:00
Dmitry Stogov 77d0587fdb Use "lea" to add/sub register with constant 2020-06-16 14:04:05 +03:00
Dmitry Stogov a459799910 Improved JIT for ZVAL_COPY_DEREF 2020-06-16 13:24:28 +03:00
David Carlier 727ae51a0c Fix JIT build on solaris/illumos
thr_self to detect the proper thread identifier but all
related typedef'd types conflict with the vtune part.
2020-06-16 11:18:50 +02:00
Nikita Popov 8b822afb0c Fix printf type 2020-06-16 10:57:29 +02:00
Dmitry Stogov bdd8406372 Added JIT debug flag to dump the size of generated code (opcache.jit_debug=0x200) 2020-06-16 11:27:34 +03:00
Dmitry Stogov a92022f878 Fixed JIT 2020-06-15 15:35:02 +03:00
Dmitry Stogov bb3d4456ee Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() check 2020-06-15 14:26:22 +03:00
Dmitry Stogov 18f2ef094a FETCH_FIM_R/IS JIT improvement 2020-06-15 12:15:56 +03:00
Dmitry Stogov 217f6e16d6 Use cheaper variant of zend_hash_index_find() 2020-06-11 01:34:55 +03:00
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
Tyson Andre 543684e796 Optimize out no-op yield from statements
If the array is empty, then I'd expect that the generator is never left,
and that can be converted to a no-op and the return value would always be `null`.

Make `yield from [];` as efficient as `if (false) { yield null; }`
when opcache's sccp pass is enabled.

Closes GH-5679
2020-06-08 09:17:13 -04:00
Dmitry Stogov 13909e5555 Fixed incorrect zend_bool type usage 2020-06-08 12:18:05 +03:00
twosee 88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
twosee 7d6a0ba808 Fix expression warnings and break warnings
Close GH-5675.
2020-06-07 10:41:11 +02:00
Máté Kocsis aa9b0ccda8 Add tests to check mismatching function signatures
Closes GH-5666
2020-06-06 09:23:34 +02: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
Nikita Popov 975acfe71e Pass zend_string message to zend_error_cb
This makes the zend_error_cb API simpler, and avoid formatting
the same message in multiple places.

It should be noted that the passed zend_string is always
non-persistent, so if you want to store it persistently somewhere,
you may still need to duplicate it.

The last_error_message is cleared a bit more aggressive, to make
sure it doesn't hang around across allocator life-cycles.

Closes GH-5639.
2020-06-05 09:54:02 +02:00
Dmitry Stogov bc37fc57e5 Avoid useless "mov" 2020-06-05 00:05:12 +03:00
Benjamin Eberlei a7908c2d11 Add Attributes
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
2020-06-04 18:19:49 +02: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
Christoph M. Becker d23cd354c0 Fix #79665: ini_get() and opcache_get_configuration() inconsistency
Overriding the given INI values in modifier callbacks is not possible,
so instead of enforcing "normalized" internal values, we just reject
the attempted changes.
2020-06-03 11:07:25 +02: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
Ilija Tovilo c599d173ab Fix php_get_args function info return type and add arg check
Closes GH-5648.
2020-05-31 17:15:58 +02:00