History log of /PHP-8.4/Zend/Optimizer/dfa_pass.c (Results 1 – 25 of 36)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1a07bb92 10-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-14873: PHP 8.4 min function fails on typed integer

The problem is that this line in the VM: `ZVAL_NULL(result);` changes the type
of arg1 as well, because after the DFA pass the r

Fix GH-14873: PHP 8.4 min function fails on typed integer

The problem is that this line in the VM: `ZVAL_NULL(result);` changes the type
of arg1 as well, because after the DFA pass the result and input both use
CV0($result).
We should not contract assignments with CVs in frameless calls with
arguments.
An older attempt is found at GH-14876 that tried to modify the VM/JIT.

Closes GH-14903.

show more ...


# 86a4fa3d 03-Jun-2024 Gina Peter Banyard

Zend/Optimizer: Fix some [-Wsign-compare] warnings


# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-12461


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3
# 0b1d750d 11-Aug-2022 Ilija Tovilo

Allow arbitrary expressions in static variable initializer

Closes GH-9301


# 3a76f795 26-Apr-2023 Ilija Tovilo

Fix incorrect match default branch optimization

Fixes GH-11134
Closes GH-11135


# d5c649b3 23-Feb-2023 Max Kellermann

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleadi

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical. This change is only about code readability.

show more ...


# 4d4a53be 09-Jan-2023 Dmitry Stogov

Fix incorrect optimization of ASSIGN_OP may lead to incorrect result (sub assign -> pre dec conversion for null values)


# 6d9d2eb3 17-Dec-2022 Ilija Tovilo

Optimize JMP[N]Z_EX to BOOL instead of QM_ASSIGN (#10108)

&& and || should always evaluate to a boolean instead of the lhs/rhs.

This optimization never gets triggered for any of our

Optimize JMP[N]Z_EX to BOOL instead of QM_ASSIGN (#10108)

&& and || should always evaluate to a boolean instead of the lhs/rhs.

This optimization never gets triggered for any of our tests.
Additionally, even if triggered this instruction gets optimized away
because the else branch of the JMP instruction will overwrite the tmp
value.

show more ...


# f31f464c 07-Nov-2022 Dmitry Stogov

Fix memory leak

Fixes oss-fuzz #52999


Revision tags: php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1
# f9055907 08-Jul-2022 George Peter Banyard

Add support for Disjoint Normal Form (DNF) types (#8725)

RFC: https://wiki.php.net/rfc/dnf_types

This allows to combine union and intersection types together in the following form (

Add support for Disjoint Normal Form (DNF) types (#8725)

RFC: https://wiki.php.net/rfc/dnf_types

This allows to combine union and intersection types together in the following form (A&B)|(X&Y)|T but not of the form (X|A)&(Y|B) or (X|A)&(Y|B)|T.

* Improve union type parsing

Co-authored-by: Sara Golemon <pollita@php.net>

show more ...


Revision tags: php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1, php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30
# 8685a7f0 27-May-2022 George Peter Banyard

Remove custom alloca() (#8513)

* Use arena in DCE instead of multiple alloca()
This requires passing the optimizer context

* Use our do_alloca() instead of alloca()

*

Remove custom alloca() (#8513)

* Use arena in DCE instead of multiple alloca()
This requires passing the optimizer context

* Use our do_alloca() instead of alloca()

* Use emalloc in DEBUG builds instead of stack allocations for do_alloca()
This helps detecting that we correctly free do_alloca()

show more ...


Revision tags: php-8.1.7RC1, php-8.0.20RC1, php-8.1.6, php-8.0.19, php-8.1.6RC1, php-8.0.19RC1, php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1
# 7e8257fb 18-Feb-2022 Dmitry Stogov

Disable ASSIGN optimization for values inferred for fatal errors.


Revision tags: php-8.1.3, php-8.0.16, php-7.4.28, php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1
# 4543cd32 30-Dec-2021 Nikita Popov

Remove JMPZNZ opcode

While JMPZNZ can avoid execution of a separate JMP opcode in some
cases, it also prevents smart branch optimization, so creating
JMPZNZ may actually have a negat

Remove JMPZNZ opcode

While JMPZNZ can avoid execution of a separate JMP opcode in some
cases, it also prevents smart branch optimization, so creating
JMPZNZ may actually have a negative effect. It also adds additional
complexity for optimizations.

Drop JMPZNZ in favor of JMPZ+JMP or JMPNZ+JMP.

Closes GH-7857.

show more ...


# eb43f8a4 27-Dec-2021 Dmitry Stogov

Eliminate more VERIFY_RETURN_TYPE instructions


# 2cf93032 25-Dec-2021 Nikita Popov

Sink op_array scope case into get_class_entry()

This handles references to the current class through its name
rather than self (and for cases where is is not linked yet and
thus not

Sink op_array scope case into get_class_entry()

This handles references to the current class through its name
rather than self (and for cases where is is not linked yet and
thus not covered by the context lookup). Rather than handling this
only for FETCH_CLASS_CONSTANT optimization, integrate this into
the generic get_class_entry() utility.

show more ...


Revision tags: php-8.0.14, php-8.1.1, php-7.4.27, php-8.1.1RC1, php-8.0.14RC1, php-7.4.27RC1, php-8.1.0, php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6, php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12, php-8.1.0RC4, php-8.0.12RC1, php-7.4.25RC1, php-8.1.0RC3
# c19977d0 27-Sep-2021 Nikita Popov

Fix delayed early binding with optimization

It's possible for delayed early binding opcodes to get optimized
away if they are "unreachable". However, we still need to attempt
early b

Fix delayed early binding with optimization

It's possible for delayed early binding opcodes to get optimized
away if they are "unreachable". However, we still need to attempt
early binding for them. (In some cases we also corrupt the early
binding list outright during optimization, which is how I got here.)

Fix this by storing information about delayed early binding
independently of DECLARE_CLASS_DELAYED opcodes, so early binding is
performed even after the opcode has been dropped.

show more ...


Revision tags: php-8.0.11
# 7e565daa 21-Sep-2021 Nikita Popov

Fix incorrect use chain unlink

This issue has been introduced in 87ea3c1f4c174b8d66af9d42e8387a2016c21c54,
where an || has been misinterpreted as an &&.


Revision tags: php-7.4.24, php-7.3.31
# 44bc9556 20-Sep-2021 George Peter Banyard

Check against FAILURE instead of different then SUCCESS


# 87ea3c1f 20-Sep-2021 George Peter Banyard

Voidify zend_ssa_unlink_use_chain()

It always returned 1 or threw an assertion failure

Also drop else branch by moving it to the main scope


# 35dfdd9b 20-Sep-2021 George Peter Banyard

Voidify zend_ssa_compute_use_def_chains()

It always returned SUCCESS


# 6c928f35 20-Sep-2021 George Peter Banyard

Voidify zend_ssa_find_false_dependencies()

It always returned SUCCESS


# ad3544b0 20-Sep-2021 George Peter Banyard

Voidify zend_ssa_find_sccs()

It always returned SUCCESS


# a06d6c36 20-Sep-2021 George Peter Banyard

Voidify zend_cfg_identify_loops()

It always returned SUCCESS


# 53c72bd6 20-Sep-2021 George Peter Banyard

Voidify zend_cfg_compute_dominators_tree()

It always returned SUCCESS


# 6a456644 20-Sep-2021 George Peter Banyard

Voidify zend_cfg_build_predecessors()

It always returned SUCCESS


12