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

4825 Commits

Author SHA1 Message Date
Dmitry Stogov fc60f2cce4 Merge branch 'PHP-8.1'
* PHP-8.1:
  Tracing JIT: Fixed missed type store in deoptimization code
2021-11-09 00:56:42 +03:00
Dmitry Stogov eda9d7ac22 Tracing JIT: Fixed missed type store in deoptimization code 2021-11-09 00:55:40 +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
Dmitry Stogov 535a0553e8 Fixed incorrect reference counter inference 2021-11-08 20:54:17 +03:00
Dmitry Stogov 85aa735bc7 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed incorrect guard elimination
2021-11-08 20:09:40 +03:00
Dmitry Stogov 9db900926c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect guard elimination
2021-11-08 20:09:01 +03:00
Dmitry Stogov 8fe808207f JIT: Fixed incorrect guard elimination 2021-11-08 20:08:39 +03:00
Nikita Popov 53df29bc29 Drop pi nodes for both old/new pred in replace_predecessor
We also need to drop pi nodes for new_pred here, as the pi node
restriction for new_pred is not necessarily true for control
coming from old_pred as well.

Fixes oss-fuzz #40782.
2021-11-08 14:56:42 +01:00
Dmitry Stogov f823999d49 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't call _zend_hash_index_find() for packed arrays
2021-11-08 13:14:11 +03:00
Dmitry Stogov 03f149799a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't call _zend_hash_index_find() for packed arrays
2021-11-08 13:13:48 +03:00
Dmitry Stogov e868ded6ef Don't call _zend_hash_index_find() for packed arrays 2021-11-08 13:13:23 +03:00
Dmitry Stogov dc06c0efc9 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed incorrect guard elimination
2021-11-08 12:29:12 +03:00
Dmitry Stogov b1b6440d84 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect guard elimination
2021-11-08 12:29:03 +03:00
Dmitry Stogov 7bf63243e1 JIT: Fixed incorrect guard elimination 2021-11-08 12:28:36 +03:00
Dmitry Stogov aa9600cfc6 Merge branch 'PHP-8.1'
* PHP-8.1:
  Tracing JIT: Fixed incorrect guard elimination
2021-11-03 23:46:02 +03:00
Dmitry Stogov 5e39ed08e1 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed incorrect guard elimination
2021-11-03 23:37:29 +03:00
Dmitry Stogov 34d22acc7e Tracing JIT: Fixed incorrect guard elimination 2021-11-03 23:37:00 +03: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 66d93c63ff Fixed type inference for FETCH_DIM_W without use 2021-11-03 19:44:38 +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 c310c61b93 Merge branch 'PHP-8.1'
* PHP-8.1:
  Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element (test)
2021-11-01 22:20:14 +03:00
Dmitry Stogov c2079802b5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element (test)
2021-11-01 22:19:28 +03:00
Dmitry Stogov 2605911272 Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element (test) 2021-11-01 22:19:10 +03:00
Dmitry Stogov b5f8b76df2 Merge branch 'PHP-8.1'
* PHP-8.1:
  Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element
2021-11-01 22:17:28 +03:00
Dmitry Stogov 8c9bfa13a9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element
2021-11-01 22:17:17 +03:00
Dmitry Stogov d7ac39b02d Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element 2021-11-01 22:14:12 +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
Dmitry Stogov 5c43e0c0ee Fixed incorrect assumption about reference counting 2021-11-01 20:28:05 +03:00
Dmitry Stogov 3602ed0460 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed numeric string index handling
2021-11-01 18:52:58 +03:00
Dmitry Stogov 8262329924 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed numeric string index handling
2021-11-01 18:52:50 +03:00
Dmitry Stogov f1e6a7d83d JIT: Fixed numeric string index handling 2021-11-01 18:50:32 +03:00
Dmitry Stogov ef345422db Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed register allocation in case of integer overflow
2021-11-01 16:48:51 +03:00
Dmitry Stogov be8c9b9476 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed register allocation in case of integer overflow
2021-11-01 16:48:44 +03:00
Dmitry Stogov cd32b47235 JIT: Fixed register allocation in case of integer overflow 2021-11-01 16:46:41 +03:00
Nikita Popov 2e29817005 Handle FETCH_DIM_R after FETCH_DIM_FUNC_ARG in inference
This can happen if a call is optimized, but FETCH_DIM_FUNC_ARG
cannot be converted to FETCH_DIM_R because it uses an UNUSED op2,
which is not supported by FETCH_DIM_R.

Fixes oss-fuzz 6144185837682688.
2021-11-01 14:26:36 +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 f8ec5a1d4c Fix range inference hang
We shouldn't switch from range to no range for ZEND_DIV and instead
explicitly return an overflowing range. Otherwise the range will
not actually get updated during widening, and we'll perform
essentially infinite narrowing.

Fixes oss-fuzz #40566.
2021-11-01 12:31:34 +01:00
Nikita Popov a899dc9d17 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix self-assign evaluation order for ASSIGN_DIM_OP
2021-11-01 09:52:19 +01:00
Nikita Popov 55aadc647b Fix self-assign evaluation order for ASSIGN_DIM_OP
For $ary[idx] op= $ary we should evaluate the RHS operand first,
otherwise we may create a reference-free recursive array. Use the
same handling we do for the normal $ary[idx] = $ary case.

Fixes oss-fuzz #40287.
2021-11-01 09:50:22 +01:00
Dmitry Stogov d2920df1de Removed debug code. 2021-10-26 10:55:58 +03:00
Dmitry Stogov 1e0fb14d81 JIT: Fixed use after free introduced in 92ad90af23 2021-10-26 10:42:03 +03:00
Dmitry Stogov 92ad90af23 JIT: Avoid ZEND_CALL_RELEASE_THIS checks 2021-10-25 23:29:51 +03:00
Dmitry Stogov c23fa4a988 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT_G(current_frame)->stacj is always true.
2021-10-25 23:26:42 +03:00
Dmitry Stogov cb72f0fa64 JIT_G(current_frame)->stacj is always true. 2021-10-25 23:26:03 +03:00
Dmitry Stogov 4b2d523771 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Avoid dead type store
2021-10-25 20:56:51 +03:00
Dmitry Stogov 3d576db280 JIT: Avoid dead type store 2021-10-25 20:56:23 +03:00