Dmitry Stogov
e2a8b3e120
Cleanup and better register usage
2020-06-23 17:51:02 +03:00
Dmitry Stogov
6ac16882d4
Reduce amount of "cold" code generated for FETCH_OBJ_* instructions
2020-06-23 17:16:44 +03:00
Dmitry Stogov
bdac60d2c0
Improve JIT for SEPARATE_ARRAY
2020-06-23 13:46:56 +03:00
Dmitry Stogov
c973f19744
Improve spill code
2020-06-23 12:27:14 +03:00
Dmitry Stogov
5681eaf5e5
Avoid register spilling
2020-06-23 11:40:36 +03:00
Dmitry Stogov
ea2b0d3c8b
Fixed JIT failures on Windows
2020-06-22 14:57:04 +03:00
Vladyslav Startsev
2c97b401c6
make bcpowmod stricter by not returning false, instead throw exception
...
Closes GH-5747
2020-06-22 09:31:55 +02:00
David Carlier
ec80b781db
Haiku opcache jit build update
2020-06-22 09:28:58 +03:00
Christoph M. Becker
6bc375f40a
Mark failing tests as XFAIL for now
...
These test fail on Window since some recent changes to JIT; we mark
them as XFAIL until the issues are resolved.
2020-06-20 11:07:57 +02:00
David Carlier
bb61346580
Fix Haiku build
...
getrusage supports only two fields. The network api sits in the network lib.
Closes GH-5732.
2020-06-19 17:21:55 +02:00
Dmitry Stogov
b4b5734d80
JIT for FETCH_OBJ_W
2020-06-19 14:36:38 +03:00
Dmitry Stogov
6fa126e966
MAY_BE_INDIRECT inference
2020-06-18 18:54:32 +03:00
Dmitry Stogov
8cbb0ffcb1
Use guards for ZEND_FETCH_OBJ_R/IS to eliminate repeatable checks
2020-06-18 11:10:47 +03:00
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