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

4585 Commits

Author SHA1 Message Date
Dmitry Stogov
04064187c2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed type inference (ASSIGN_OP with typed reference may cause type conversion)
2021-10-11 10:50:06 +03:00
Dmitry Stogov
ed8ec9d71e Fixed type inference (ASSIGN_OP with typed reference may cause type conversion) 2021-10-11 10:48:49 +03:00
Dmitry Stogov
30f1f4b75b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect double/long register hinting
2021-10-08 15:47:21 +03:00
Dmitry Stogov
bbd875268a JIT: Fixed incorrect double/long register hinting 2021-10-08 15:46:49 +03:00
Dmitry Stogov
26bc7b38fb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed extension handling
2021-10-08 14:08:34 +03:00
Dmitry Stogov
b279de416e JIT: Fixed extension handling 2021-10-08 14:06:32 +03:00
Dmitry Stogov
b2c43a4efb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Flush error messages emitted during preloading
2021-10-08 12:35:38 +03:00
Dmitry Stogov
45b127ad4a Flush error messages emitted during preloading 2021-10-08 12:34:25 +03:00
Dmitry Stogov
c9fb384c40 JIT ARM64: Use proper register 2021-10-08 09:56:44 +03:00
Dmitry Stogov
d12d987686 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed FETCH_LIST_R on string
2021-10-07 22:15:30 +03:00
Dmitry Stogov
7cea20f937 JIT: Fixed FETCH_LIST_R on string 2021-10-07 22:13:39 +03:00
Dmitry Stogov
6bf1d24fbc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed bug #81512 (Unexpected behavior with arrays and JIT)
2021-10-07 21:29:04 +03:00
Dmitry Stogov
b47a48ff80 Fixed bug #81512 (Unexpected behavior with arrays and JIT) 2021-10-07 21:24:38 +03:00
Nikita Popov
71e82b9de2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Check exception after undef var notice
2021-10-07 17:01:16 +02:00
Nikita Popov
b564113756 Check exception after undef var notice
For simple assignments, we may not emit an exception check elsewhere,
so perform it directly after the undef var notice.
2021-10-07 16:54:26 +02:00
Nikita Popov
d5e4f8ffe8 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Handle undefined dim in assign_dim_helper
2021-10-07 15:35:45 +02:00
Nikita Popov
08c29a657d Handle undefined dim in assign_dim_helper
Not only the value can be undefined here, but the offset as well.
2021-10-07 15:35:16 +02:00
Nikita Popov
e32c850d4f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Set opline before calling undef op helper
  JIT: Fixed wrong comparison skip
2021-10-07 14:40:38 +02:00
Nikita Popov
455837139e Set opline before calling undef op helper 2021-10-07 14:38:02 +02:00
Dmitry Stogov
a743fd7633 JIT: Fixed wrong comparison skip 2021-10-07 15:27:56 +03:00
Dmitry Stogov
7eab93bcbb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect reference handling in PRE_INC/DEC_OBJ
2021-10-07 14:34:46 +03:00
Dmitry Stogov
6ab36fb6f9 JIT: Fixed incorrect reference handling in PRE_INC/DEC_OBJ 2021-10-07 14:34:18 +03:00
Dmitry Stogov
919fd56d7a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect code generation for JMPZ
2021-10-07 13:55:14 +03:00
Dmitry Stogov
cd45bd0a81 JIT: Fixed incorrect code generation for JMPZ 2021-10-07 13:48:28 +03:00
Dmitry Stogov
fd8dfc4248 XFAIL: Return types cannot be inferred through prototypes 2021-10-06 17:21:02 +03:00
Dmitry Stogov
5557d15311 JIT ARM64: Fixed NaN handling 2021-10-06 16:50:25 +03:00
Dmitry Stogov
6e086681f5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed NaN handling
2021-10-06 16:36:38 +03:00
Dmitry Stogov
8a0873020a JIT: Fixed NaN handling 2021-10-06 16:35:33 +03:00
Dmitry Stogov
0b5d62e39c Fixed type inference that may cause JIT failure
PHP allows to override a method that returns non-reference with a method
that returns a reference. This mean that we cannot use prototypes to
predict return types of a child functions.
2021-10-06 14:55:34 +03:00
Dmitry Stogov
5ed654ee95 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed register clobbering
2021-10-06 12:22:06 +03:00
Dmitry Stogov
f681f9075c JIT: Fixed register clobbering 2021-10-06 12:10:39 +03:00
Nikita Popov
3661c1932c Fix array cast type inference wrt packed arrays
Use KEY_LONG instead of PACKED if it's possible for the array to
be empty. It won't be packed in that case.

Fixes oss-fuzz #39650.
2021-10-06 10:50:44 +02:00
Dmitry Stogov
831a1717f6 JIT: Fixed incorrect overflow detection introduced in a5e502ef4d 2021-10-06 10:18:18 +03:00
Nikita Popov
a4fa00ead3 Reuse wrong string offset logic in jit
JIT contains a copy of this function that effectively only differs
by fetching current_execute_data from EG. We can do that in the VM
version as well, as this is just used to throw an error.

Export the VM function and reuse it in JIT.
2021-10-05 16:33:31 +02:00
Nikita Popov
c5e96daa41 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix return type verification with undef var
2021-10-05 15:34:37 +02:00
Nikita Popov
f890c9c5e3 Fix return type verification with undef var
This was loading EG(uninitialized_value) into r0 rather than
FCARG1a.

However, if we fix this issue an existing test fails because
the undef var warning promoted to exception is not caught early
enough, so we need to explicitly check for the exception before
performing the type check.
2021-10-05 15:30:55 +02:00
Dmitry Stogov
41dc14792e Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed SSA construction
2021-10-05 16:14:58 +03:00
Dmitry Stogov
22ef1fb832 Fixed SSA construction 2021-10-05 16:14:39 +03:00
Dmitry Stogov
a5e502ef4d JIT: Combine type guard with overflow detection 2021-10-05 14:43:34 +03:00
Nikita Popov
c958adce70 POST_INC_OBJ/POST_DEC_OBJ don't have optional result
Possibly we should be encoding this in the opcode metadata, rather
than maintaining a separate list.

Fixes oss-fuzz #39503.
2021-10-05 12:05:39 +02:00
Nikita Popov
e8e4852ebb Restore CE_CACHE clear on persist
We still need to do this in case early binding succeeds and caches
the class. We could guard that by !in_compilation as well, but in
this case the previous cache clearing should be reliable, so
restore it.
2021-10-05 10:31:46 +02:00
Dmitry Stogov
2c95c945be JIT: Eliminate useless EG(exception) checks after FETCH_DIM_* 2021-10-04 22:28:26 +03:00
Dmitry Stogov
724c4fb2e5 JIT: Avoid duplicate EX(opline) assignment 2021-10-04 17:50:26 +03:00
Nikita Popov
ac70bb362e Don't populate CE_CACHE during compilation
It's possible for CE_CACHE slots to be populated during compilation
(e.g. due to an early binding attempt). When opcache then persists
the class, it clears the CE_CACHE slot for the class name as declared,
but not for different spellings (that only differ in case). As such,
a pointer to the old, non-persistent class entry may be retained.

Fix this by not populating CE_CACHE if in_compilation is set.

Closes GH-7542.
2021-10-04 15:38:01 +02:00
Dmitry Stogov
066f543cac JIT: Use zend_compare() instead of comapre_function() 2021-10-04 15:49:41 +03:00
Nikita Popov
304d78b7dc Revert "JIT: Use zend_compare() instead of comapre_function()"
Temporarily revert this change to unbreak CI, which currently
always times out.

This reverts commit 9b3069f0a3.
This reverts commit 3d35ac0b05.
2021-10-01 16:15:40 +02:00
Dmitry Stogov
9b3069f0a3 JIT: Fixed test failures introduced in 3d35ac0b05
ext/date/tests/DateTimeZone_compare_basic1.phpt
ext/intl/tests/timezone_equals_error.phpt
2021-10-01 10:22:34 +03:00
Dmitry Stogov
3d35ac0b05 JIT: Use zend_compare() instead of comapre_function() 2021-10-01 00:53:18 +03:00
Dmitry Stogov
7be7ec3098 JIT: Allow register allocation for result of STRLEN and COUNT instructions 2021-09-30 21:50:53 +03:00
Nikita Popov
d0860f67ca Fix cache slot assignment for ASSIGN_OBJ_OP
ASSIGN_OBJ_OP stores the cache slot in OP_DATA, so this ended up
overwriting the binop opcode instread.
2021-09-30 14:34:12 +02:00