summaryrefslogtreecommitdiff
path: root/ext/opcache
Commit message (Collapse)AuthorAgeFilesLines
* Keep JIT region executable under ZTSDylan K. Taylor2021-01-191-4/+13
| | | | | | | | | | | | | When one thread tries to compile a script, another thread may already be executing JITed code. In this case we can't make the memory non-executable. This violates the W^X principle, but doesn't seem to be avoidable for ZTS builds for now. The same problem does not exist for NTS, as it's a different process executing there, which has it's own memory protection mapping. Closes GH-6595.
* Observe unused return values in JITNikita Popov2021-01-191-12/+7
| | | | | Even if the return value is not used, it should still be available to the observer.
* Fixed bug #80422 (php_opcache.dll crashes when using Apache 2.4 with JIT)Dmitry Stogov2021-01-141-0/+5
|
* Add guard if lvalue of assignment may be a reference, but wasn't a reference ↵Dmitry Stogov2021-01-111-0/+5
| | | | during recording
* Fix/improve mysqli stubsDharman2021-01-061-6/+6
| | | | | | | | * mysqli_commit $flags default value is 0, not -1. * A number of functions cannot actually return null. * mysqli_poll parameter names were incorrect, as this function has a different signature from select. * fetch functions apart from fetch_all can return false on failure.
* Initialize EX(call)->func by single instructionDmitry Stogov2020-12-291-7/+17
|
* Reuse value stored in %r0 instead of immediate operandDmitry Stogov2020-12-291-2/+2
|
* Eliminate redundand comparison insructionsDmitry Stogov2020-12-243-14/+117
|
* Optimize out result value of ASSIGN, ASSIGN_OP and INC/DEC opcodes, if possible.Dmitry Stogov2020-12-151-1/+109
|
* JIT: Update invalid opcache.jit INI value message to include "tracing" and ↵Ayesh Karunaratne2020-12-151-1/+1
| | | | | | | | | "function" values `opcache.jit` accepts `tracing` and `function` as aliases, but they were not mentioned in the start-up INI warning message. This updates the error message to include all possible values. Closes GH-6490.
* JIT disabled build fix.David Carlier2020-12-151-0/+2
| | | | Closes GH-6514.
* Remove unused flagDmitry Stogov2020-12-142-6/+1
|
* Fixed bug #80506 (Immediate SIGSEGV upon ini_set("opcache.jit_debug", 1))Dmitry Stogov2020-12-141-0/+2
|
* Eliminate some repeatable IS_REFERENCE checksDmitry Stogov2020-12-101-15/+47
|
* Perform early guard type check for result of FETCH_CONSTANTDmitry Stogov2020-12-095-26/+65
|
* Fixed IS_32BIT/IS_SIGNED_32BIT messDmitry Stogov2020-12-091-17/+17
|
* Avoid unnecessary checksDmitry Stogov2020-12-081-2/+6
|
* Fixed bug #80480 (Segmentation fault with JIT enabled)Dmitry Stogov2020-12-071-21/+37
|
* Fix failing VirtualProtect() callsChristoph M. Becker2020-12-021-0/+3
| | | | | | | Whenever JIT is disabled due to incompatibilities, we also need to set `JIT_G(on)` to zero. Closes GH-6470.
* Bug #80447 (Strange out of memory error when running with JIT)Dmitry Stogov2020-12-012-1/+35
|
* Skip test if JIT is not availableDmitry Stogov2020-12-011-0/+1
|
* Preallocate stack space for JIT in execute_ex() to eliminate JIT ↵Dmitry Stogov2020-11-301-16/+36
| | | | prologue/epilogue.
* Fixed "may be used uninitialized" compilation warningsDmitry Stogov2020-11-301-0/+3
|
* Hide phpdbg/JIT incompatibility macro (JIT is disabled for phpdbg)Dmitry Stogov2020-11-301-1/+5
|
* Disable JIT with incompatible third-party extensionsDmitry Stogov2020-11-304-4/+55
|
* Only replace IN_ARRAY result type for JMPZ/JMPNZNikita Popov2020-11-302-10/+24
| | | | | | | | | | | | | | Replacing the result type in the general case is dangerous, because not all opcodes support both VAR and TMP. One common case is the in_array() result being passed to SEND_VAR, which would have to be changed to SEND_VAL. Rather than complicating this logic, reduce the scope to only doing the type replacement for JMPZ and JMPNZ. The only reason we're doing this in the first place is to enable the smart branch optimization, so we can limit it to the relevant opcodes. Replacing the result type may be marginally useful in other cases as well (as it may avoid reference checks), but not worth the bother.
* Respect strict_types during sccp function call evaluationNikita Popov2020-11-273-6/+30
| | | | | Similar to what we do with attributes, add a dummy call frame on which we can set the strict_types flag.
* Don't check for throwing calls in sccp function evaluationNikita Popov2020-11-271-200/+121
| | | | | | We only need to reject functions that could warn (or have runtime dependent behavior). If a function can throw in some cases, just let it and discard the result.
* Fix handling of sccp exceptionsNikita Popov2020-11-273-4/+20
| | | | | | We should clear the exception *before* we destroy the execute_data. Add a variation of the test that indirects through another file, and would crash otherwise.
* Handle exceptions during SCCP function evaluationNikita Popov2020-11-272-0/+21
| | | | | Easier to handle them than to ensure they can't happen in the first place.
* Avoid direct calls to zend_cpu_supports()Nikita Popov2020-11-271-2/+2
| | | | | | While the use of zend_cpu_supports_*() is only strictly necessary inside ifunc resolvers, where the cpu state has not been initialized yet, we should prefer the compiler builtins in all cases.
* Move avx check into a macroNikita Popov2020-11-271-17/+19
|
* Fixed bug #80433Nikita Popov2020-11-272-4/+16
| | | | Use ZEND_STRTOL to allow leading zeros in opcache.jit option.
* Eliminate deafd storesDmitry Stogov2020-11-261-4/+28
|
* Fixed bug #80377Nikita Popov2020-11-251-1/+1
| | | | | | | | | | | Make sure the $PHP_THREAD_SAFETY variable is always available when configuring extensions. It was previously available for phpized extensions, but for in-tree builds it was being set too late. Then, use $PHP_THREAD_SAFETY instead of $enable_zts to check for ZTS in bundled extensions, which makes sure these checks also work for phpize builds.
* Use diferent temporary register (%r0 may keep a method address)Dmitry Stogov2020-11-251-3/+3
|
* Revert "Fixed bug #80377"Dmitry Stogov2020-11-251-1/+1
| | | | This reverts commit fc26ad9b1220fdfd7db15ecaff5e7c38283c55b6.
* Fixed bug #80377Nikita Popov2020-11-241-1/+1
| | | | | | Use $PHP_THREAD_SAFETY instead of $enable_zts to check for ZTS. This variable is also available for phpize builds, while enable_zts is only present for in-tree builds.
* Fixed bug #80404Nikita Popov2020-11-241-12/+29
| | | | | | | | | | For a division like [1..1]/[2..2] produce [0..1] as a result, which would be the integer envelope of the floating-point result. The implementation is pretty ugly (we're now taking min/max across eight values...) but I couldn't come up with a more elegant way to handle this that doesn't make things a lot more complex (the division sign handling is the annoying issue here).
* zend_jit_trace_stack_frame.stack can't be NULLDmitry Stogov2020-11-231-1/+0
|
* Fixed use-after-free in PHPUnit testsDmitry Stogov2020-11-231-0/+3
|
* Keep value of register before possible side exitDmitry Stogov2020-11-231-1/+27
|
* Use MIN/MAX when dumping RANGE[]Nikita Popov2020-11-201-0/+4
| | | | | | It's very common that one of the bounds is LONG_MIN or LONG_MAX. Dump them as MIN/MAX instead of the int representation in that case, as it makes the dump less noisy.
* Fixed incorrect TRACE_FRAME_MASK_NESTED flag settingDmitry Stogov2020-11-201-1/+7
|
* Fixed 32-bit JITDmitry Stogov2020-11-203-3/+3
|
* Added missing deoptimization code for trampoline handlingDmitry Stogov2020-11-194-1/+26
|
* Fixed register clobberingDmitry Stogov2020-11-181-0/+4
|
* Fixed trampoline handlingDmitry Stogov2020-11-175-105/+161
|
* Fixed allocated register clobberingDmitry Stogov2020-11-171-22/+47
|
* Fixed false pasitive ASAN NULL pointer dereference warningDmitry Stogov2020-11-171-1/+1
|