1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Commit Graph

671 Commits

Author SHA1 Message Date
Alex Dowad d44235acae Convert numeric string array keys to integers correctly in JITted code
While fixing bugs in mbstring, one of my new test cases failed with a strange
error message stating: 'Warning: Undefined array key 1...', when clearly the
array key had been set properly.

GDB'd that sucker and found that JIT'd PHP code was calling directly into
`zend_hash_add_new` (which was not converting the numeric string key to an
integer properly). But where was that code coming from? I examined the disasm,
looked up symbols to figure out where call instructions were going, then grepped
the codebase for those function names. It soon became clear that the disasm I
was looking at was compiled from `zend_jit_fetch_dim_w_helper`.
2020-10-30 22:07:08 +02:00
Dmitry Stogov b133183e35 Create TSSA loops for recursive call/return traces and move invariant type guards out of loops. 2020-10-30 13:08:31 +03:00
Dmitry Stogov 47a56208f0 Fixed memory leak in Zend/tests/bug78999.phpt 2020-10-28 10:47:23 +03:00
Dmitry Stogov e6b51ccc58 Fixed tracing JIT support for aliasses (Zend/tests/bug75420.13.phpt and ext/standard/tests/streams/bug60106.phpt) 2020-10-27 23:44:29 +03:00
Dmitry Stogov 43e493884c Fixed support for named parameters (Zend/tests/named_params/references.phpt) 2020-10-27 16:35:24 +03:00
Dmitry Stogov 45e2b9a7dd Fixed support for typed references 2020-10-27 12:59:35 +03:00
Dmitry Stogov b8a6717da6 Fixed tracing JIT for tests/classes/unset_properties.phpt 2020-10-27 10:30:38 +03:00
Dmitry Stogov a17cec446a Fixed memory leak 2020-10-27 01:20:22 +03:00
Dmitry Stogov ba525a68d9 Fixed register allocation 2020-10-26 21:48:47 +03:00
Dmitry Stogov 9d3cc223b2 Better JIT support for aliases 2020-10-26 19:05:08 +03:00
Dmitry Stogov 0fa154ad8d Fixed incorrect register allocation in ext/gd/tests/imagecopyresampled_variation1.phpt 2020-10-26 15:56:37 +03:00
Javier Eguiluz c64dcda5e5 Fixed some typos
Closes GH-6373.

[ci skip]
2020-10-23 09:34:09 +02:00
Dmitry Stogov 0f8518f875 Fixed register allocation 2020-10-22 23:16:41 +03:00
Dmitry Stogov 5626dcdb9d Missed warning 2020-10-22 23:15:15 +03:00
Dmitry Stogov 20cbb233c4 Checj type guards before loading values into CPU registers 2020-10-22 18:23:49 +03:00
Dmitry Stogov 30cf0a04bf Avoid register allocation for ASSIGN into aliased variable (it might be indirectly changed into IS_REFERENCE) 2020-10-22 18:22:36 +03:00
Dmitry Stogov cb6f9a6568 More accurate live range construction 2020-10-21 16:05:13 +03:00
Dmitry Stogov 9efb258fc1 Eliminate useless mov(s) 2020-10-21 16:03:28 +03:00
Dmitry Stogov a1cac4fefc Eliminate dead type store 2020-10-20 23:37:19 +03:00
Dmitry Stogov 0ac810bbc5 Improve JIT for fetching character form string 2020-10-20 20:29:33 +03:00
Dmitry Stogov 5e17d88b63 Improve register allocator (register reuse) 2020-10-20 13:46:32 +03:00
Dmitry Stogov ea1590937b Improve register allocator (give preference to loop variables). 2020-10-20 12:19:44 +03:00
Dmitry Stogov fc2d477c5b Avoid partial register stall 2020-10-19 23:22:43 +03:00
Dmitry Stogov bf321f0c14 Use zero-extended mov insted of sign-signed movsxd 2020-10-19 19:39:51 +03:00
David Carlier 3841ea338e DragonFlyBSD build update for opcache JIT part.
Closes GH-6339.
2020-10-15 14:50:23 +02:00
Dmitry Stogov 5572318166 Avoid refcounting when return CV (similar to optimization in VM). 2020-10-15 15:27:00 +03:00
Dmitry Stogov 06bb1feb09 Added missing side exit 2020-10-14 01:17:39 +03:00
Dmitry Stogov 62ae21bbf2 Give preference to live-ranges with register hints to improve register reuse. 2020-10-13 13:59:53 +03:00
Dmitry Stogov 872787c5f7 Avoid useless register allocation 2020-10-13 11:37:33 +03:00
Dmitry Stogov 87beb22ff8 Perform trace range propagation 2020-10-13 00:18:17 +03:00
Dmitry Stogov 1c596ff146 Eliminate dead stores 2020-10-12 22:59:30 +03:00
Dmitry Stogov 57bb3a3966 Eliminate dead load 2020-10-09 18:58:03 +03:00
Dmitry Stogov fc14dbb713 Keep the same JIT code for PHP-8.0 and master (workaround against PHP-8.0 ABI freeze) 2020-10-09 16:54:26 +03:00
Dmitry Stogov 080784acfd Eliminate more dead type stores 2020-10-09 16:15:07 +03:00
Nikita Popov 6188b7a1da Revert "Change calling convention of zval_update_constant[_ex]() to fastcall."
This reverts commit 5a447b086b.

Revert this ABI break from PHP-8.0, leaving it only on master.
2020-10-09 15:06:12 +02:00
Dmitry Stogov 6f888b90c5 Eliminate more dead type stores 2020-10-09 14:31:20 +03:00
Dmitry Stogov 2ad96b8cee Eliminate more dead type stores 2020-10-08 23:26:31 +03:00
Dmitry Stogov e5830c4a6b Eliminate dead type stores 2020-10-08 19:15:23 +03:00
Dmitry Stogov 8efcc280be Cleanup (expand and remove simple macros) 2020-10-08 19:15:23 +03:00
Dmitry Stogov 5a447b086b Change calling convention of zval_update_constant[_ex]() to fastcall. 2020-10-08 02:04:38 +03:00
Dmitry Stogov 45441b3c11 Pass arguments to cdecl functions through preallocated stack slots 2020-10-08 00:52:30 +03:00
Dmitry Stogov db7a773b1c Add more hints for register allocator 2020-10-07 20:38:52 +03:00
Dmitry Stogov c80662a927 Eliminate check 2020-10-06 15:50:37 +03:00
Dmitry Stogov 84e0ea6b43 Optimize out double memory load 2020-10-06 13:32:55 +03:00
Dmitry Stogov 31f54586b5 Use range inference to eliminate useless comparisons 2020-10-05 22:33:45 +03:00
Dmitry Stogov 90b80c8278 Fix trace range inference 2020-10-05 22:33:18 +03:00
Dmitry Stogov 109fb3e57d Copy optimization for (BINARY_OP/ACCIGN + SEND_VAL) 2020-10-02 12:06:02 +03:00
Dmitry Stogov b0e77066bd Fixed JIT for BINARY_OP with expected overflow 2020-10-02 11:01:35 +03:00
Dmitry Stogov fbf153a210 Fixed possible incorrect register usage 2020-10-02 10:48:45 +03:00
Dmitry Stogov 29dd1240f3 Clenup BINARY_OP + SEND_VAL optimization 2020-10-01 22:39:58 +03:00