summaryrefslogtreecommitdiff
path: root/ext/opcache
Commit message (Collapse)AuthorAgeFilesLines
* Improved JIT for TYPE_CHECK opcodeDmitry Stogov2021-03-252-26/+76
|
* Improve JIT for IS_IDENTICALDmitry Stogov2021-03-251-18/+36
|
* Replace function with macroDmitry Stogov2021-03-243-13/+5
|
* Move system independent code out from x86 specific headerDmitry Stogov2021-03-233-190/+204
|
* Move x86 dependent code out from platform independed parts.Dmitry Stogov2021-03-234-23/+33
|
* Use capstone disassembler, if available.Dmitry Stogov2021-03-235-30/+214
|
* Support VERIFY_RETURN_TYPE elision with unused operandNikita Popov2021-03-221-0/+23
| | | | | | | | | | This handles the degenerate case where SCCP replaced the value in the RETURN opcode with a constant, but the VERIFY_RETURN is still there. We can still apply the same optimization, just don't need to adjust the use list in this case. The result is still sub-optimal in that a dead QM_ASSIGN is left behind.
* Use zend_string* instead of char*Dmitry Stogov2021-03-225-46/+48
|
* Use zend_hash_lookup()Dmitry Stogov2021-03-193-44/+6
|
* Support prototypes in call graphNikita Popov2021-03-193-4/+56
| | | | | | | | | | Even if we don't know the exact method being called, include it in the call graph with the is_prototype flag. In particular, we can still make use of return types from prototype methods, as PHP 8 makes LSP violations a hard error. Most other places are adjusted to skip calls with !is_prototype. Maybe some of them would be fine, but ignoring them is conservative.
* Allow inferring narrowed return typeNikita Popov2021-03-181-0/+44
| | | | | | Even if an explicit return type is given, we might still infer a more narrow one based on return statements. We shouldn't pessimize this just because a type has been declared.
* Update one more use of NO_AUTOLOADNikita Popov2021-03-181-2/+3
|
* Update opt testNikita Popov2021-03-181-1/+1
| | | | And fix a type in the fetch class flags dumping while here.
* Merge branch 'PHP-8.0'Dmitry Stogov2021-03-172-1/+112
|\ | | | | | | | | * PHP-8.0: Fixed bug #80861 (erronous array key overflow in 2D array with JIT)
| * Fixed bug #80861 (erronous array key overflow in 2D array with JIT)Dmitry Stogov2021-03-172-1/+112
| |
* | Implement enumsIlija Tovilo2021-03-173-9/+59
| | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/enumerations Co-authored-by: Nikita Popov <nikita.ppv@gmail.com> Closes GH-6489.
* | Merge branch 'PHP-8.0'Dmitry Stogov2021-03-172-0/+43
|\ \ | |/ | | | | | | * PHP-8.0: Fixed bug #80839 (PHP problem with JIT)
| * Fixed bug #80839 (PHP problem with JIT)Dmitry Stogov2021-03-172-0/+43
| |
| * Fix refcount inference for typed propertiesNikita Popov2021-03-161-4/+3
| | | | | | | | | | We were not adding RC1/RCN if the MAY_BE_OBJECT came from a class type and there was no other refcounted type in the union.
* | Avoid unnecessary static_variables persistenceNikita Popov2021-03-173-30/+32
| | | | | | | | | | | | | | static_variables should be treated the same way as all other op_array components nowadays (only static_variables_ptr is special). There's no need to persist/serialize it is separately per shared op_array.
* | Simplify attribute persistenceNikita Popov2021-03-171-27/+23
| | | | | | | | | | For an inherited op_array, directly fetch the xlat entry, as we do for everything else.
* | Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-168-167/+134
| | | | | | | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* | Merge branch 'PHP-8.0'Nikita Popov2021-03-151-1/+1
|\ \ | |/ | | | | | | * PHP-8.0: ext/opcache: fix configure output while checking mmap MAP_ANON support
| * ext/opcache: fix configure output while checking mmap MAP_ANON supportMichael Heimpold2021-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It seems that f3efb9e3fb introduced a "typo" which may result in the following confusing message: checking for mmap() using MAP_ANON shared memory support... no=yes Let's fix this. Signed-off-by: Michael Heimpold <mhei@heimpold.de> Closes GH-6758.
* | Inheritance cache optimizationDmitry Stogov2021-03-112-3/+7
| |
* | Fixed assertion (ext/opcache/zend_persist.c:327: ↵Dmitry Stogov2021-03-101-2/+3
| | | | | | | | zend_accel_get_type_map_ptr: Assertion `ret > 2' failed)
* | Merge branch 'PHP-8.0'Dmitry Stogov2021-03-101-2/+2
|\ \ | |/ | | | | | | * PHP-8.0: Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage)
| * Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available ↵Dmitry Stogov2021-03-101-2/+2
| | | | | | | | for static Thread Local Storage)
* | Merge branch 'PHP-8.0'Nikita Popov2021-03-051-0/+3
|\ \ | |/ | | | | | | * PHP-8.0: Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.
| * Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be ↵David Carlier2021-03-051-0/+3
| | | | | | | | | | | | applied in addition. Closes GH-6738.
* | Merge branch 'PHP-8.0'Christoph M. Becker2021-03-051-1/+1
|\ \ | |/ | | | | | | * PHP-8.0: Print error code if CreateMutex() fails
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-03-051-1/+1
| |\ | | | | | | | | | | | | * PHP-7.4: Print error code if CreateMutex() fails
| | * Print error code if CreateMutex() failsChristoph M. Becker2021-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This issue came up recently in a bug report[1]; without the error code, users can barely guess why the function failed. [1] <https://bugs.php.net/80812> Closes GH-6745.
| | * Fixed bug #80805Nikita Popov2021-03-012-4/+33
| | | | | | | | | | | | | | | | | | Handle missing result_var in binary_op_result_type. (cherry picked from commit 8446e2827585c37d0739f8d44fa8d359cbbb6551)
* | | Fix dynamic func def persist with preloadingNikita Popov2021-03-041-0/+1
| | | | | | | | | | | | | | | If we find an existing serialization of the op_array, of course we also need to actually make use of it...
* | | Switch to new ZPPDmitry Stogov2021-03-041-3/+3
| | |
* | | Merge branch 'PHP-8.0'Dmitry Stogov2021-03-021-0/+49
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
| * | Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)Dmitry Stogov2021-03-011-0/+49
| | |
* | | Reference dynamic functions through dynamic_defsNikita Popov2021-03-014-28/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, dynamically declared functions and closures are inserted into the function table under a runtime definition key, and then later possibly renamed. When opcache is not used and a file containing a closure is repeatedly included, this leads to a very large memory leak, as the no longer needed closure declarations will never be freed (https://bugs.php.net/bug.php?id=76982). With this patch, dynamic functions are instead stored in a dynamic_func_defs member on the op_array, which opcodes reference by index. When the parent op_array is destroyed, the dynamic_func_defs it contains are also destroyed (unless they are stilled used elsewhere, e.g. because they have been bound, or are used by a live closure). This resolves the fundamental part of the leak, though doesn't completely fix it yet due to some arena allocations. The main non-obvious change here is to static variable handling: We can't destroy static_variables_ptr in destroy_op_array, as e.g. that would clear the static variables in a dynamic function when the op_array containing it is destroyed. Static variable destruction is separated out for this reason (we already do static variable destruction separately for normal functions, so we only need to handle main scripts). Closes GH-5595.
* | | Allow pointer to end of memory in IS_UNSERIALIZED()Nikita Popov2021-02-241-2/+4
| | | | | | | | | | | | | | | | | | We already use <= for IS_SERIALIZED(), but the same general problem can also occur for IS_UNSERIALIZED(). We don't seem to hit this in practice prior to GH-5595 though.
* | | Merge branch 'PHP-8.0'Dmitry Stogov2021-02-242-4/+31
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1)
| * | Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1)Dmitry Stogov2021-02-242-4/+31
| | |
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-232-10/+36
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80786
| * | Fixed bug #80786Nikita Popov2021-02-232-10/+36
| | | | | | | | | | | | | | | | | | | | | Don't use r0 as temporary register in math_double_long if it is already used for a memory result. This was already done in one branch, but not the other.
* | | Reduce ZPP API overheadDmitry Stogov2021-02-201-7/+6
| | |
* | | Fix static variable behavior with inheritanceNikita Popov2021-02-185-73/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a method is inherited, the static variables will now always use the initial values, rather than the values at the time of inheritance. As such, behavior no longer depends on whether inheritance happens before or after a method has been called. This is implemented by always keeping static_variables as the original values, and static_variables_ptr as the modified copy. Closes GH-6705.
* | | Merge branch 'PHP-8.0'Dmitry Stogov2021-02-173-12/+100
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts)
| * | Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in ↵Dmitry Stogov2021-02-173-12/+100
| | | | | | | | | | | | code involving bitshifts)
* | | Merge branch 'PHP-8.0'Dmitry Stogov2021-02-162-3/+101
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)
| * | Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)Dmitry Stogov2021-02-162-3/+101
| | |