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

2130 Commits

Author SHA1 Message Date
Dmitry Stogov
53b329e278 Fix GH-15101: _ir_RSTORE: Assertion `ctx->control' (#15153) 2024-07-29 19:17:25 +03:00
Ilija Tovilo
a0a8624346 Fix throw in IS_IDENTICAL in JIT (#15103)
We need to persist opline in case zend_is_identical() throws.
2024-07-25 13:18:47 +02:00
Dmitry Stogov
7b25cac32b Update IR
IR commit: 8fb33ceccd39d0052c5949cf96fc135e7ba1fbcb
2024-07-22 09:43:11 +03:00
Ilija Tovilo
fdbe910b3b Fix indirect readonly error messages (#14979)
$obj->ro[] = 42;, passByRef($obj->ro); and the likes should emit an indirect
modification error message. This message already existed but was used
inconsistently.
2024-07-16 23:24:07 +02:00
Ilija Tovilo
780a8280d2 [RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00
Peter Kokot
9e94d2b040 Autotools: Refactor builtin checks (#14835)
This creates a single M4 macro PHP_CHECK_BUILTIN and removes other
PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and
PHP_HAVE_BUILTIN_* CPP macro definitions are defined to 1 if builtin
is found and undefined if not.

This also changes all PHP_HAVE_BUILTIN_ symbols to be either undefined
or defined (to value 1) and syncs all #if/ifdef/defined usages of them
in the php-src code. This way it is simpler to use them because they
don't need to be defined to value 0 on Windows, for example. This is
done as previous usages in php-src were mixed and on many places they
were only checked with ifdef.
2024-07-08 21:25:16 +02:00
Niels Dossche
23391f1fe7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:42 +02:00
Niels Dossche
d3992b6d09 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:35 +02:00
Niels Dossche
b44ad27a78 Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
Closes GH-14847.
2024-07-07 13:18:01 +02:00
Niels Dossche
fa5e29f7d0 Remove always-false if check
prop_info is NULL in this branch.
2024-07-02 02:51:18 -07:00
Niels Dossche
00691f4322 Remove always-true if check 2024-07-02 02:51:18 -07:00
Niels Dossche
00b36ce44a Remove always-false opcode check
opcode cannot be ZEND_POST_INC because of the if check above.
2024-07-02 02:51:18 -07:00
Niels Dossche
7407e760f1 Remove duplicated code
The exact same code already exists above this.
2024-07-02 02:51:18 -07:00
Niels Dossche
985e5ffdb0 Remove doubled variable name from assignment 2024-07-02 02:51:18 -07:00
Benjamin Eberlei
72c874691b RFC: Add #[\Deprecated] Attribute (#11293)
see https://wiki.php.net/rfc/deprecated_attribute

Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-07-02 09:44:25 +02:00
Peter Kokot
c44834d8ad Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Peter Kokot
5d359cd4e5 Remove unused PHP-8.3 generated JIT files (#14622)
This remove unused PHP-8.3 generated JIT files and adds PHP-8.3
generated JIT files back to .gitignore to have smoother workflow
when switching PHP branches this can be ignored for a branch
or two.
2024-06-21 17:33:57 +02:00
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
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
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
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] bf56e8b9c8/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
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
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