History log of /PHP-8.2/Zend/Optimizer/dfa_pass.c (Results 1 – 25 of 34)
Revision Date Author Comments
# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

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

Closes GH-12461


# 0b1d750d 11-Aug-2022 Ilija Tovilo

Allow arbitrary expressions in static variable initializer

Closes GH-9301


# 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 ...


# 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 ...


# 3a76f795 26-Apr-2023 Ilija Tovilo

Fix incorrect match default branch optimization

Fixes GH-11134
Closes GH-11135


# 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)


# f31f464c 07-Nov-2022 Dmitry Stogov

Fix memory leak

Fixes oss-fuzz #52999


# 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 ...


# 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 ...


# 7e8257fb 18-Feb-2022 Dmitry Stogov

Disable ASSIGN optimization for values inferred for fatal errors.


# 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 ...


# 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 ...


# 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 &&.


# 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


# 50378666 20-Sep-2021 George Peter Banyard

Voidify zend_build_cfg()

It always returned SUCCESS


# 53d5420d 20-Sep-2021 George Peter Banyard

Use more appropriate types in Optimizer

Mainly using zend_result and bool instead of int


12