History log of /PHP-8.4/Zend/Optimizer/pass1.c (Results 1 – 25 of 28)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# c5745f40 13-Oct-2024 Ilija Tovilo

Fix array to string conversion warning emitted in optimizer

Fixes GH-16408
Closes GH-16380


# a79c70f5 14-Aug-2024 Gina Peter Banyard

[RFC] Convert exit (and die) from language constructs to functions (#13483)

RFC: https://wiki.php.net/rfc/exit-as-function


# c461b600 24-May-2024 Levi Morrison

refactor: change `zend_is_true` to return `bool` (#14301)

Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,

refactor: change `zend_is_true` to return `bool` (#14301)

Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,
`main/streams/xp_socket.c` does:

sockopts |= STREAM_SOCKOP_IPV6_V6ONLY_ENABLED * zend_is_true(tmpzval);

And `Zend/zend_compile.c` does:

child = &ast->child[2 - zend_is_true(zend_ast_get_zval(ast->child[0]))];

I changed a few places trivially from `int` to `bool`, but there are
still many places such as the object handlers which return `int` that
should eventually be `bool`.

show more ...


# 56cf09f2 18-Mar-2024 Máté Kocsis

Improve optimizer support for class constants (#13438)

The following optimizations are added:

- Constant folding of final class constants
- Type inference of typed class constan

Improve optimizer support for class constants (#13438)

The following optimizations are added:

- Constant folding of final class constants
- Type inference of typed class constants

show more ...


# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

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

Closes GH-12461


# 3e2dbbf9 07-Jul-2023 George Peter Banyard

Add support for deprecating class constants


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


# 3b62d660 04-Aug-2022 sji

Implement constants in traits (#8888)

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


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


# 1050edae 26-Dec-2021 Nikita Popov

Extract special function evaluation from pass1

Pass1 handles a number of special functions that can be evaluated
under some circumstances. Move the core logic into a separate
helper,

Extract special function evaluation from pass1

Pass1 handles a number of special functions that can be evaluated
under some circumstances. Move the core logic into a separate
helper, as I believe that SCCP should reuse this.

show more ...


# 924e8756 26-Dec-2021 Nikita Popov

Minor code cleanup in pass1

Move literal destruction into helper and use a common result
variable to make code more compact.


# 206d80e1 25-Dec-2021 Nikita Popov

Reuse get_class_entry_from_op1() helper

Export and reuse this helper in places that fetch a class entry
from op1.


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


# 046096f2 25-Dec-2021 Nikita Popov

Remove outdated FETCH_CLASS handling in FETCH_CLASS_CONSTANT optimization

Nowadays self::X is represented using an UNUSED operand with
FETCH_CLASS_SELF flag rather than a separate FETCH_

Remove outdated FETCH_CLASS handling in FETCH_CLASS_CONSTANT optimization

Nowadays self::X is represented using an UNUSED operand with
FETCH_CLASS_SELF flag rather than a separate FETCH_CLASS instruction.
The code already handles the new pattern.

show more ...


# f6dce4a8 25-Dec-2021 Nikita Popov

Extract common replacement login in pass1

The replace const or replace with QM_ASSIGN pattern is common to
all constant folding, extract it into a function.


# 08840484 25-Dec-2021 Nikita Popov

Don't exclude arrays from constant collection

These are supported as constants nowadays, so we can drop the
string check.

Also fix a potential leak, though I believe this doesn'

Don't exclude arrays from constant collection

These are supported as constants nowadays, so we can drop the
string check.

Also fix a potential leak, though I believe this doesn't matter in
current usage, as it will effectively be suppressed during persist.

show more ...


Revision tags: php-8.0.14, php-8.1.1, php-7.4.27
# cf377eef 06-Dec-2021 Nikita Popov

Don't convert assign op operand types in opcache

This is the same change as 56b18d478ed9e40afd66860e82017d5c2017eac1
but for ASSIGN_OP. Changing the operand type may change the error

Don't convert assign op operand types in opcache

This is the same change as 56b18d478ed9e40afd66860e82017d5c2017eac1
but for ASSIGN_OP. Changing the operand type may change the error
message and can result in different behavior with operator overloading.

As with the other patch, if there is strong interest this could be
added to the DFA pass instead, with an appropriate type check.

show more ...


Revision tags: php-8.1.1RC1, php-8.0.14RC1, php-7.4.27RC1, php-8.1.0
# 1845b712 18-Nov-2021 Nikita Popov

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


Revision tags: 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, php-8.0.11, php-7.4.24, php-7.3.31
# fea9b5cf 20-Sep-2021 George Peter Banyard

Use zend_string_equals_literal() macro


Revision tags: php-8.1.0RC2, php-7.4.24RC1, php-8.0.11RC1, php-8.1.0RC1, php-7.4.23, php-8.0.10, php-7.3.30, php-8.1.0beta3
# a4e20680 10-Aug-2021 Nikita Popov

Use zend_string_equals_literal_ci()


Revision tags: php-8.0.10RC1, php-7.4.23RC1, php-8.1.0beta2, php-8.0.9, php-7.4.22, php-8.1.0beta1, php-7.4.22RC1, php-8.0.9RC1, php-8.1.0alpha3, php-7.4.21, php-7.3.29, php-8.0.8, php-8.1.0alpha2
# 0d9269de 18-Jun-2021 Nikita Popov

Extract helper for fetching class entry in optimizer

This code is repeated a few time. Two occurrences additionally
contained checks for user classes in CG(class_table) with the
same

Extract helper for fetching class entry in optimizer

This code is repeated a few time. Two occurrences additionally
contained checks for user classes in CG(class_table) with the
same file name, but as far as I know these should always be in
the script class_table, so I'm omitting the check here.

show more ...


Revision tags: php-7.4.21RC1, php-8.0.8RC1, php-8.1.0alpha1, php-8.0.7, php-7.4.20
# b6958bb8 31-May-2021 George Peter Banyard

Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)

RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <

Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)

RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

show more ...


Revision tags: php-8.0.7RC1, php-7.4.20RC1
# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...


Revision tags: php-8.0.6, php-7.4.19
# fd1d5ec2 28-Apr-2021 Nikita Popov

Add ZEND_CLASS_CONST_FLAGS() macro

And drop Z_ACCESS_FLAGS(). We no longer store *only* access flags
in these.


Revision tags: php-7.4.18, php-7.3.28, php-8.0.5
# 6cd0b48c 19-Apr-2021 Matt Brown

Implement never return type

The never type can be used to indicate that a function never
returns, for example because it always unwinds.

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

Implement never return type

The never type can be used to indicate that a function never
returns, for example because it always unwinds.

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

Closes GH-6761.

show more ...


12