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

255 Commits

Author SHA1 Message Date
Dmitry Stogov c2aea6e805 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fix incorrect reference counting inference
2021-11-30 13:00:13 +03:00
Dmitry Stogov 3564001502 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix incorrect reference counting inference
2021-11-30 13:00:04 +03:00
Dmitry Stogov e1baef1835 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed type inference (it's safe to ignore reference counting narrowing)
2021-11-29 23:40:49 +03:00
Dmitry Stogov 2d3ea98624 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed type inference (it's safe to ignore reference counting narrowing)
2021-11-29 23:39:37 +03:00
Dmitry Stogov 8cdead1568 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fix exception handling when next array element is already occupied
2021-11-29 21:57:38 +03:00
Dmitry Stogov 23c5a6fd16 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix exception handling when next array element is already occupied
2021-11-29 21:57:29 +03:00
Dmitry Stogov ee38e3ac37 Merge branch 'PHP-8.1'
* PHP-8.1:
  Disable type narrowing optimization when we contruct SSA for JIT
2021-11-29 15:54:53 +03:00
Dmitry Stogov c6e895aec2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Disable type narrowing optimization when we contruct SSA for JIT
2021-11-29 15:53:16 +03:00
Nikita Popov 902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Dmitry Stogov 7dcf853235 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect narrowing to double
2021-11-25 15:16:03 +03:00
Dmitry Stogov b1a1ed380f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect narrowing to double
2021-11-25 15:15:01 +03:00
Dmitry Stogov 35786e321b Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect refcountion inference for BW_NOT
2021-11-25 13:53:35 +03:00
Dmitry Stogov ecc4d1326b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect refcountion inference for BW_NOT
2021-11-25 13:53:26 +03:00
Dmitry Stogov 40b258fb78 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect DCE for ADD_ARRAY_ELEMENT instruction
2021-11-25 13:36:04 +03:00
Dmitry Stogov 97f0c0b189 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect DCE for ADD_ARRAY_ELEMENT instruction
2021-11-25 13:35:54 +03:00
Nikita Popov b9165671d5 Verify that used SSA variables are defined
There should either be a defining instruction, defining phi, or
it should be an undef entry variable.
2021-11-25 11:18:36 +01:00
Nikita Popov 71b2f46798 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug #81652
2021-11-24 15:20:38 +01:00
Nikita Popov 51ae5c5397 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug #81652
2021-11-24 15:19:33 +01:00
Nikita Popov 1845b712e7 Remove commented code in pass1
This has been disabled for a long time, and the whole optimization
is no longer relevant given changes in PHP 8.1
2021-11-18 14:51:55 +01:00
Máté Kocsis d608319529 Merge branch 'PHP-8.1'
* PHP-8.1:
  Add more specific array return type hints for various extensions - part 2
  Add the --generate-optimizer-info option to the help of gen_stub.php
2021-11-17 10:57:01 +01:00
Máté Kocsis 20fb26e55c Add more specific array return type hints for various extensions - part 2
ext/ftp, ext/gmp, ext/intl

Closes GH-7433
2021-11-17 10:56:27 +01:00
Dmitry Stogov e1c561508d Merge branch 'PHP-8.1'
* PHP-8.1:
  Optimize closures nested in other closures
2021-11-15 13:33:23 +03:00
Dmitry Stogov f313b65acb Optimize closures nested in other closures 2021-11-15 13:32:42 +03:00
Dmitry Stogov b976e75def Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed reference-counting inference
2021-11-15 10:40:51 +03:00
Dmitry Stogov fb582f4230 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed reference-counting inference
2021-11-15 10:40:35 +03:00
Dmitry Stogov b7f19f2674 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect reference counter inference
2021-11-08 20:55:09 +03:00
Dmitry Stogov 9bd490dc33 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect reference counter inference
2021-11-08 20:54:45 +03:00
Nikita Popov e506564e08 Merge branch 'PHP-8.1'
* PHP-8.1:
  Drop pi nodes for both old/new pred in replace_predecessor
2021-11-08 14:58:42 +01:00
Nikita Popov e5c2ad45dd Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Drop pi nodes for both old/new pred in replace_predecessor
2021-11-08 14:57:16 +01:00
Máté Kocsis fdf63bfef3 Merge branch 'PHP-8.1'
* PHP-8.1:
  Add more specific array return type hints for various extensions - part 1
2021-11-07 08:48:49 +01:00
Máté Kocsis d02b9b953d Add more specific array return type hints for various extensions - part 1
ext/bz2, ext/calendar, ext/dba, ext/enchant

Closes GH-7432
2021-11-07 08:46:25 +01:00
Dmitry Stogov e465218e35 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed type inference for FETCH_DIM_W without use
2021-11-03 19:45:42 +03:00
Dmitry Stogov 22a171a0b5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed type inference for FETCH_DIM_W without use
2021-11-03 19:45:30 +03:00
Dmitry Stogov 90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Dmitry Stogov bcef615959 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect assumption about reference counting
2021-11-01 20:29:27 +03:00
Dmitry Stogov d4a7e4d1ff Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect assumption about reference counting
2021-11-01 20:28:33 +03:00
Nikita Popov b4f2b24430 Merge branch 'PHP-8.1'
* PHP-8.1:
  Handle FETCH_DIM_R after FETCH_DIM_FUNC_ARG in inference
2021-11-01 14:27:22 +01:00
Nikita Popov a89546d8b3 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Handle FETCH_DIM_R after FETCH_DIM_FUNC_ARG in inference
2021-11-01 14:27:14 +01:00
Nikita Popov b41adb16cd Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix range inference hang
2021-11-01 12:32:15 +01:00
Nikita Popov 3d38960979 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix range inference hang
2021-11-01 12:32:04 +01:00
Nikita Popov 8d1db82c32 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix scdf loop var free check for phi vars
2021-11-01 11:04:23 +01:00
Nikita Popov 64878757be Fix scdf loop var free check for phi vars
The variable may come from a phi node, in which case we should
take the defining block from it.

Fixes oss-fuzz #40453.
2021-11-01 11:03:17 +01:00
Nikita Popov b743cd72d0 Fix inference if FETCH_DIM_W user optimized away
In this case the user may be a FREE.

Also add the test file that I forgot in
3ce472d1a6.
2021-10-21 09:58:07 +02:00
Nikita Popov e7a5ec5fd9 Merge branch 'PHP-8.1'
* PHP-8.1:
  Handle operand replacement in JMP_NULL
2021-10-19 15:19:39 +02:00
Nikita Popov 1f19401ffa Handle operand replacement in JMP_NULL
In this case it's not sufficient to replace the JMP_NULL operand,
as it keeps the temporary alive and there may be more uses later.
Fix this by generalizing existing handling for other similar opcodes
like CASE/SWITCH and LIST_R.

Fixes oss-fuzz 5820123475214336.
2021-10-19 15:19:02 +02:00
Dmitry Stogov 564d54192f Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect optimization that may cause JIT assertion
2021-10-18 23:21:01 +03:00
Dmitry Stogov bdebefaa61 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect optimization that may cause JIT assertion
2021-10-18 23:20:53 +03:00
Nikita Popov a00446ca90 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't replace tmp with cv in YIELD argument
2021-10-12 14:27:13 +02:00
Nikita Popov 9c1d7b43e9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't replace tmp with cv in YIELD argument
2021-10-12 14:27:07 +02:00
Dmitry Stogov 176c319109 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed type inference for COPY_TMP
2021-10-11 16:56:49 +03:00