History log of /PHP-8.3/Zend/Optimizer/zend_inference.c (Results 51 – 75 of 98)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 8e58828e 10-Apr-2022 Nikita Popov

Add debug assertion on type narrowing

This ensures that this will show up as a fuzzing failure.


# 323f3c69 10-Apr-2022 Nikita Popov

Improve file/line information for narrowing warning

Report the file/line of the opline rather than the include location.

This should make issues like #8251 easier to debug.


Revision tags: php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1
# aced867a 28-Feb-2022 Dmitry Stogov

Fix typr inference

Fixes oss-fuzz #45020


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


# 2759e6bc 27-Dec-2021 Dmitry Stogov

Fixed assertion when check "instanceof" on unlinked class


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


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
# 902d6439 11-Oct-2021 Nikita Popov

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()/

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

show more ...


# b743cd72 21-Oct-2021 Nikita Popov

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
3ce472d1a6c4d1df61db0cdd79e656f20f4fbf0d.


Revision tags: php-8.0.12RC1
# 3661c193 06-Oct-2021 Nikita Popov

Fix array cast type inference wrt packed arrays

Use KEY_LONG instead of PACKED if it's possible for the array to
be empty. It won't be packed in that case.

Fixes oss-fuzz #39650.


Revision tags: php-7.4.25RC1, php-8.1.0RC3
# 5bf088f6 28-Sep-2021 Nikita Popov

Move TYPE_CHECK handling from sccp to inference

The handling of TYPE_CHECK makes for an awkward special case,
because it is determined outside the usual SCCP framework. Instead
move

Move TYPE_CHECK handling from sccp to inference

The handling of TYPE_CHECK makes for an awkward special case,
because it is determined outside the usual SCCP framework. Instead
move the logic into type inference (to infer a more specific
may_be_true or may_be_false if possible). This will get picked up
by SCCP through the existing logic to make use of type and range
information.

However, this also requires us to make use of type info in
feasible edge marking, otherwise we would regress existing
optimization power.

show more ...


# 944d653b 29-Sep-2021 Nikita Popov

Fix inference for INIT_ARRAY with illegal offset type

Extract assign_dim_array_result_type() helper that can be reused
for INIT_ARRAY and implements all this logic correctly.

Fi

Fix inference for INIT_ARRAY with illegal offset type

Extract assign_dim_array_result_type() helper that can be reused
for INIT_ARRAY and implements all this logic correctly.

Fixes oss-fuzz 5156868775870464.

show more ...


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

Check against FAILURE instead of different then SUCCESS


# 25deb7d2 20-Sep-2021 George Peter Banyard

Voidify zend_mark_cv_references()

It always returned SUCCESS


# 85634c9c 20-Sep-2021 George Peter Banyard

Voidify zend_infer_ranges()

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


# 53d5420d 20-Sep-2021 George Peter Banyard

Use more appropriate types in Optimizer

Mainly using zend_result and bool instead of int


Revision tags: php-8.1.0RC2
# 353461ae 13-Sep-2021 Dmitry Stogov

Separate zend_array_type_info() to avoid loop inlining


Revision tags: 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
# 1ffbb737 13-Aug-2021 Dmitry Stogov

Better specialization for packed/hash arrays

- improved packed/hash inference.
- added hash guards for ASSIGN_DIM, ASSIGN_DIM_OP, FETCH_DIM_W* instructions
- more accurate invariant

Better specialization for packed/hash arrays

- improved packed/hash inference.
- added hash guards for ASSIGN_DIM, ASSIGN_DIM_OP, FETCH_DIM_W* instructions
- more accurate invariant type guards motion
- invariant packed/hash guards motion
- rename MAY_BE_ARRAY_HASH into MAY_BE_ARRAY_NUMERIC_HASH and add MAY_BE_ARRAY_STRING_HASH
- cleanup

show more ...


# aaa14501 11-Aug-2021 Dmitry Stogov

Make private functions "static" and remove unused zend_inference_check_recursive_dependencies().


# 315f4094 11-Aug-2021 Nikita Popov

Always use CE_CACHE, remove TYPE_HAS_CE (#7336)

Currently, CE_CACHE on strings is only used with opcache interned strings. This
patch extends usage to non-opcache interned strings as wel

Always use CE_CACHE, remove TYPE_HAS_CE (#7336)

Currently, CE_CACHE on strings is only used with opcache interned strings. This
patch extends usage to non-opcache interned strings as well. This means that
most type strings can now make use of CE_CACHE even if opcache is not loaded,
which allows us to remove TYPE_HAS_CE kind, and fix some discrepancies
depending on whether a type stores a resolved or non-resolved name.

There are two cases where CE_CACHE will not be used:

* When opcache is not used and a permanent interned string (that is not an
internal class name) is used as a type name during the request. In this case
we can't allocate a map_ptr index for the permanent string, as it would be
not be in the permanent map_ptr index space.
* When opcache is used but the script is not cached (e.g. eval'd code or
opcache full). If opcache is used, we can't allocate additional map_ptr
indexes at runtime, because they may conflict with indexes allocated by
opcache.

In these two cases we would end up not using CE caching for property types
(argument/return types still have the separate cache slot).

show more ...


Revision tags: php-8.0.10RC1, php-7.4.23RC1
# df6ffa80 09-Aug-2021 Dmitry Stogov

Improve Range Inference

Support for simple negative range constraints on induction variables


Revision tags: php-8.1.0beta2, php-8.0.9, php-7.4.22
# e2194c18 21-Jul-2021 Nikita Popov

FETCH_STATIC_PROP_IS may return undef

We don't go out of our way to convert IS_UNDEF to IS_NULL for
this opcode. Reflect this in type info.


# e3d90fa7 21-Jul-2021 Nikita Popov

Transfer MAY_BE_INDIRECT for VERIFY_RETURN

If the input is indirect, the output will be indirect too.


1234