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

6100 Commits

Author SHA1 Message Date
Jakub Zelenka b5c6d57c05 Merge branch 'PHP-8.3' 2024-06-19 00:06:10 +01:00
Dmitry Stogov 1f48715798 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
2024-06-17 09:38:17 +03:00
Dmitry Stogov e842ddfe4f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
2024-06-17 09:38:02 +03:00
Dmitry Stogov 350af549a0 Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558) 2024-06-17 09:37:44 +03:00
Bob Weinand 6a2c5318f9 Optimize observers (#13649)
Inline the lookup whether a function is observed at all.
This strategy is also used for FRAMELESS calls. If the frameless call is observed, we instead allocate a call frame and push the arguments, to call the the function afterwards.
Doing so is still a performance benefit as opposed to executing individual INIT_FCALL+SEND_VAL ops. Thus, even if the frameless call turns out to be observed, the call overhead is slightly lower than before.
If the internal function is not observed at all, the unavoidable overhead is fetching the FLF zend_function pointer and the run-time cache needs to be inspected.

As part of this work, it turned out to be most viable to put the result operand on the ZEND_OP_DATA instead of ZEND_FRAMELESS_ICALL_3, allowing seamless interoperability with the DO_ICALL opcode.
This is a bit unusual in comparison to all other ZEND_OP_DATA usages, but seems to not pose problems overall.

There is also a small issue resolved: trampolines would always use the ZEND_CALL_TRAMPOLINE_SPEC_OBSERVER function due to zend_observer_fcall_op_array_extension being set to -1 too late.
2024-06-15 14:42:27 +02:00
Niels Dossche a4674654ab opcache: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07:00
Peter Kokot 5d3fab9334 Sync #if/ifdef/defined (#14520)
These are either undefined or defined (to value 1):
- __DragonFly__
- __FreeBSD__
- HAS_MCAST_EXT
- HAVE_GETCWD
- HAVE_GETWD
- HAVE_GLIBC_ICONV
- HAVE_JIT
- HAVE_LCHOWN
- HAVE_NL_LANGINFO
- HAVE_RL_CALLBACK_READ_CHAR
- HAVE_RL_ON_NEW_LINE
- HAVE_SQL_EXTENDED_FETCH
- HAVE_UTIME

Follow up of GH-5526 (-Wundef)
2024-06-11 22:47:05 +02:00
Gina Peter Banyard 7130a174bb ext/opcache/jit: Fix -Wundef warning for HAVE_CAPSTONE
All other times this symbol is references #ifdef is used
2024-06-10 14:19:59 +01:00
Dmitry Stogov 6c9d443a21 Update IR
IR commit: 5be6dd81f19f85bc06085617e7231f8699d7f9b0
2024-06-10 11:49:08 +03:00
Peter Kokot 84a0da1574 Sync #if/ifdef/defined (#14508)
This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRENT_H
- HAVE_DLFCN_H
- HAVE_GETTIMEOFDAY
- HAVE_LIBDL
- HAVE_POLL_H
- HAVE_PWD_H
- HAVE_SCANDIR
- HAVE_SYS_FILE_H
- HAVE_SYS_PARAM_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_TIME_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_WAIT_H
- HAVE_UNISTD_H
- PHP_WIN32
- ZEND_WIN32

These are either undefined or defined to 1 in Autotools and Windows.

Follow up of GH-5526 (-Wundef).
2024-06-09 14:23:41 +02:00
Peter Kokot 743d1fd2a2 Sync -Wno-implicit-fallthrough
This is a sync of the https://github.com/php/php-src/pull/6252 after few
years:
- ext/date: pending recheck in GH-14187
- ext/hash: warning happens only on 32-bit build in
  ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c
- ext/opcache: IR JIT doesn't seem to have this issue
- ext/pcre remains disabled due to pcre2lib/sljit/sljitNativeARM_64.c
  (should be rechecked and fixed upstream)
2024-06-08 20:04:21 +02:00
Niels Dossche 89c4e4c4cb Fix GH-11188: Error when building TSRM in ARM64 (for IR JIT) (#14459)
This is GH-11236 for IR JIT.
2024-06-04 19:47:07 +02:00
Niels Dossche 3e8752169c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-11188: Error when building TSRM in ARM64
2024-06-03 21:11:20 +02:00
nielsdos 644d3628e3 Fix GH-11188: Error when building TSRM in ARM64
Although the issue mentioned FreeBSD, this is a broader problem:
the current ARM64 code to load the TLS offset assumes a setup with
the non-default TLS model. This problem can also apply on some
configurations on other platforms.

Closes GH-11236.
2024-06-03 20:28:55 +02:00
Dmitry Stogov 802612bb54 Update IR
IR commit: 97555e12b525b825ab3b2f12bfdfd5cb6c00b2b4
2024-06-03 12:20:07 +03:00
Peter Kokot ca55603d8a Wrap ext/opcache AC_RUN_IFELSE checks in AC_CACHE_CHECK (#14436)
Cache variables php_cv_shm_ipc and php_cv_shm_mmap_anon enable manual
overriding of checks when cross-compiling.
2024-06-02 19:51:47 +02:00
Arnaud Le Blanc cc6d9523d9 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix TLS access in JIT on FreeBSD/amd64
2024-05-28 15:45:45 +02:00
Arnaud Le Blanc 5e895dda15 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix TLS access in JIT on FreeBSD/amd64
2024-05-28 15:43:59 +02:00
Arnaud Le Blanc 79862f24da Fix TLS access in JIT on FreeBSD/amd64
DTV elements are 8 bytes in size a per ABI [1], and the index is offset by 1
on FreeBSD [2]

[1] http://people.redhat.com/drepper/tls.pdf
[2] https://github.com/freebsd/freebsd-src/blob/bf56e8b9c8639ac4447d223b83cdc128107cc3cd/libexec/rtld-elf/rtld.c#L5260

Closes GH-13928
2024-05-28 15:42:57 +02:00
Dmitry Stogov 5109cf1010 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix incorrect conditions
2024-05-28 08:38:00 +03:00
Dmitry Stogov 034bd85ad1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incorrect conditions
2024-05-28 08:37:48 +03:00
Dmitry Stogov 48ae025c33 Fix incorrect conditions 2024-05-28 08:37:20 +03:00
Dmitry Stogov 58c281a6cf JIT: Add CPU registers support for ASSIGN_OBJ and ASSIGN_OBJ_OP (#14303)
* JIT: Add CPU registers support for ASSIGN_OBJ and ASSIGN_OBJ_OP

* Fix tests failures

* Fix tests failures

* Add missing GUARD
2024-05-23 19:25:06 +03:00
Ilija Tovilo 706e9ed058 Merge branch 'PHP-8.3'
* PHP-8.3:
  Skip JIT test if php is compiled without jit
2024-05-23 16:35:58 +02:00
Ilija Tovilo 69a800151b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Skip JIT test if php is compiled without jit
2024-05-23 16:35:51 +02:00
Ilija Tovilo 04c9749e35 Skip JIT test if php is compiled without jit 2024-05-23 16:35:29 +02:00
Dmitry Stogov 93c20de2f0 Update IR
IR commit: e87914bda3939072bf1e470e923599d73063d9f1
2024-05-23 09:40:35 +03:00
Dmitry Stogov ace18f4919 JIT: Avoid IS_UNDEF check for ZEND_FETCH_DIM/OBJ_IS with a result type guard (#14298) 2024-05-22 17:33:40 +03:00
Ilija Tovilo 92b9543ca9 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix enabling of JIT at runtime
2024-05-22 14:33:33 +02:00
Ilija Tovilo 706e79761e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix enabling of JIT at runtime
2024-05-22 14:33:25 +02:00
Ilija Tovilo 9506ca6001 Fix enabling of JIT at runtime
Fixes GH-14267
Closes GH-14294
2024-05-22 14:32:43 +02:00
Cristian Rodríguez 8e62e2b829 Mark multple functions as static (#13864)
* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

struct sigaction act, old_term, old_quit, old_int;
all unused.

* optimizer: minXOR and maxXOR are unused
2024-05-22 13:11:46 +02:00
Dmitry Stogov 896517e24f JIT: Fix missing register store
Fixes master_COMMUNITY_asan "nightly" failure introduced by 13d5c812e0
2024-05-21 14:11:26 +03:00
Dmitry Stogov 13d5c812e0 JIT: Add CPU registers support for FETCH_OBJ_R (#14253) 2024-05-19 22:18:30 +03:00
Ilija Tovilo 600d591cae Omit FETCH_THIS in closures
Non-static closures are guaranteed to have $this. The existing comment
highlights this, but fails to handle it correctly.

Closes GH-14181
2024-05-16 12:28:11 +02:00
Dmitry Stogov 5e7baaaad1 JIT: Remove old restriction. FETCH_DIM_R supports regs for indexes.
This affects only function JIT.
2024-05-16 12:02:03 +03:00
Dmitry Stogov 7843e72f3b JIT: Avoid useless EG(exception) check in ASSIGN_DIM_OP (#14247) 2024-05-15 21:31:44 +03:00
Dmitry Stogov 5ef1824ebc JIT: Improve x86_64 code generated for PHP Array Bounds Checks (#14246) 2024-05-15 16:38:23 +03:00
Dmitry Stogov 0eb68eb8d8 JIT: Fix incorrect deoptimization info
Fixes third recently introduced failure in "Nightly" "master_COMMUNUTY_asan" job
2024-05-15 14:22:20 +03:00
Dmitry Stogov 273c2de6a7 JIT: Fix incorrect PHP register allocation
Fixes 2 of 3 recently introduced failures in "Nightly"
"master_COMMUNUTY_asan" job
2024-05-15 12:46:58 +03:00
Dmitry Stogov 446ff6a742 JIT: Implement CPU register usage for ASSIGN_DIM_OP (#14236) 2024-05-14 23:35:31 +03:00
Dmitry Stogov 4a91c8a1be JIT: Implement CPU register usage for ASSIGN_OP (#14235) 2024-05-14 22:54:00 +03:00
Dmitry Stogov c8920aaf94 JIT: JIT: Implement CPU register usage for ISSET_ISEMPTY_DIM (#14227) 2024-05-14 14:05:04 +03:00
Dmitry Stogov 64f4aca6ba IT: Implement CPU register usage for FETCH_DIM_W (#14225) 2024-05-14 13:19:56 +03:00
Dmitry Stogov bf7d4d7eb2 JIT: Implement CPU register usage for ASSIGN_DIM (#14224) 2024-05-14 12:10:28 +03:00
Dmitry Stogov 89305574b2 JIT: Improve CPU register usage in FETCH_DIM_R, FETCH_DIM_IS and FETCH_LIST_R (#14222) 2024-05-14 01:12:01 +03:00
Dmitry Stogov 7e2831f074 Update IR
IR commit: 94e71e613221e79b033c48b54230e128755c95f9
2024-05-13 20:26:24 +03:00
Dmitry Stogov bb21d195c1 Update IR
IR commit: fe4ba285bc576d83bea4a8099fb7315b8bc8c7fb
2024-05-06 22:22:15 +03:00
Ilija Tovilo 858008b1c6 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix persisting of inherited class constants
2024-05-06 16:02:29 +02:00
Ilija Tovilo 929bbb23d1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix persisting of inherited class constants
2024-05-06 16:02:20 +02:00