History log of /PHP-8.1/Zend/zend_opcode.c (Results 1 – 25 of 440)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
Revision tags: php-8.1.7RC1
# b1b79c74 11-May-2022 Dmitry Stogov

Fix memory leak

This fixes oss-fuzz #47088

# a44d99fe 07-Mar-2022 Bob Weinand

Merge branch 'PHP-8.0' into PHP-8.1


# 0d7e10c1 07-Mar-2022 Tim Düsterhus

Fix memory leak of function attribute hash table (#8070)

==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==109253== at 0x4

Fix memory leak of function attribute hash table (#8070)

==109253== 280 (56 direct, 224 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
==109253== at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==109253== by 0x6D9FA2: __zend_malloc (zend_alloc.c:3068)
==109253== by 0x745138: zend_add_attribute (zend_attributes.c:226)
==109253== by 0x6680D1: zend_add_parameter_attribute (zend_attributes.h:102)
==109253== by 0x66B787: zm_startup_zend_test (test.c:478)
==109253== by 0x7224CD: zend_startup_module_ex (zend_API.c:2202)
==109253== by 0x72252C: zend_startup_module_zval (zend_API.c:2217)
==109253== by 0x734288: zend_hash_apply (zend_hash.c:2011)
==109253== by 0x722C30: zend_startup_modules (zend_API.c:2328)
==109253== by 0x67409B: php_module_startup (main.c:2256)
==109253== by 0x88EDDE: php_cli_startup (php_cli.c:409)
==109253== by 0x890F61: main (php_cli.c:1334)

show more ...

Revision tags: php-8.1.4RC1, php-8.1.3, php-8.1.2RC1, php-8.1.0
# 44e5d253 16-Nov-2021 Nikita Popov

Fix inheritance of class constants if mutable data used

Class constants from parents should always be directly reused,
rather than re-evaluated as a separate copy. Previously this used

Fix inheritance of class constants if mutable data used

Class constants from parents should always be directly reused,
rather than re-evaluated as a separate copy. Previously this used
to happen automatically, as we'd just inherit the class constant
entry from the parent class. With mutable data there may now be
a separate copy of the constant, so we need to use that copy
when updating constants. Otherwise we may evaluate the same
constant multiple times.

Closes GH-7658.

show more ...

Revision tags: php-7.3.33
# 1039852f 11-Nov-2021 Nikita Popov

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Fix COPY_TMP live range construction with optimization


# 8c4a7f20 11-Nov-2021 Nikita Popov

Fix COPY_TMP live range construction with optimization

The use may be optimized away, leaving us only with the free use.
Also fix off-by-one error in the other optimization case.

Revision tags: php-7.3.32
# 8360e9d6 05-Oct-2021 Nikita Popov

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Fix COPY_TMP live range construction after optimization


# bbd3f714 05-Oct-2021 Nikita Popov

Fix COPY_TMP live range construction after optimization

If we optimize the FREE away, we should switch to constructing
a normal live range, rather than a split live range.

Fixes

Fix COPY_TMP live range construction after optimization

If we optimize the FREE away, we should switch to constructing
a normal live range, rather than a split live range.

Fixes oss-fuzz #39548.

show more ...

Revision tags: php-7.3.31
# 78795440 16-Sep-2021 Nikita Popov

Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
Handle SWITCH_STRING with optimized away FREE


# 7257e7e5 16-Sep-2021 Nikita Popov

Handle SWITCH_STRING with optimized away FREE

This can happen in degenerate cases where we know that the
SWITCH_STRING argument is not refcounted. We should be treating it
in the sam

Handle SWITCH_STRING with optimized away FREE

This can happen in degenerate cases where we know that the
SWITCH_STRING argument is not refcounted. We should be treating it
in the same way as SWITCH_LONG here.

show more ...

Revision tags: php-7.3.30
# e0119525 28-Jul-2021 Nikita Popov

Preload unlinked classes, remove preload autoload (#7311)

Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be re

Preload unlinked classes, remove preload autoload (#7311)

Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be referenced from functions that
did get preloaded, there is a preload autoload mechanism to load them at
runtime.

Since PHP 8.1, we can safely preload unlinked classes, which will then go
through usual lazy loading. This means that we no longer need the preload
autoload mechanism. However, we need to be careful not to modify any hash
table buckets in-place, and should create new buckets for lazy loaded classes.

show more ...

# a374230c 22-Jul-2021 Nikita Popov

Add support for internal enums

This adds support for internal enums with the same basic approach
as userland enums. Enum values are stored as CONSTANT_AST and
objects created during

Add support for internal enums

This adds support for internal enums with the same basic approach
as userland enums. Enum values are stored as CONSTANT_AST and
objects created during constant updating at runtime. This means
that we need to use mutable_data for internal enums.

This just adds basic support and APIs, it does not include the
stubs integration from #7212.

Closes GH-7302.

show more ...

# 36d2dd08 23-Jul-2021 Nikita Popov

Remove redundant static_members/mutable_data cleanup

static_members, mutable_data and static vars in methods are cleaned
up during an earlier shutdown phase (because this has to happen

Remove redundant static_members/mutable_data cleanup

static_members, mutable_data and static vars in methods are cleaned
up during an earlier shutdown phase (because this has to happen
before we destroy the object store). There is no need to repeat
this cleanup when destroying the classes.

show more ...

# 3eb97a45 22-Jul-2021 Nikita Popov

Always use separate static_members_table

When running without opcache, static_members_table is shared with
default_static_members_table. This is visible in reflection output,
because

Always use separate static_members_table

When running without opcache, static_members_table is shared with
default_static_members_table. This is visible in reflection output,
because ReflectionProperty::getDefaultValue() will return the
current value, rather than the default value.

Address this by never sharing the table, which matches the behavior
we already see under opcache.

Fixes bug #80821.

Closes GH-7299.

show more ...

Revision tags: php-7.3.29
# 79071d5e 29-Apr-2021 Nikita Popov

Don't duplicate internal prop info (#6929)

Userland property infos are no longer duplicated since PHP 7.4, when we
stopped setting SHADOW flags on inherited private properties. Stop dupl

Don't duplicate internal prop info (#6929)

Userland property infos are no longer duplicated since PHP 7.4, when we
stopped setting SHADOW flags on inherited private properties. Stop duplicating
internal property infos as well.

This requires switching class destruction to work in reverse order, as child
classes may be reusing structures from parent classes, and as such should be
destroyed first.

show more ...

Revision tags: php-7.3.28, php-7.3.27, php-7.3.26, php-7.3.26RC1, php-7.3.25, php-7.3.25RC1, php-7.3.24, php-7.3.24RC1
# 5caaf40b 29-Sep-2020 George Peter Banyard

Introduce pseudo-keyword ZEND_FALLTHROUGH

And use it instead of comments

Revision tags: php-7.3.23, php-7.3.23RC1, php-7.3.22, php-7.3.22RC1, php-7.3.21, php-7.3.21RC1, php-7.3.20, php-7.3.20RC1
# 269c8dac 10-Jun-2020 Ilija Tovilo

Implement enums

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

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

Closes GH-6489.

Revision tags: php-7.3.19, php-7.4.7RC1, php-7.3.19RC1
# 47a2e5c7 18-May-2020 Nikita Popov

Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then late

Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.

show more ...

# 5d160e30 17-Feb-2021 Nikita Popov

Fix static variable behavior with inheritance

When a method is inherited, the static variables will now always
use the initial values, rather than the values at the time of
inheritan

Fix static variable behavior with inheritance

When a method is inherited, the static variables will now always
use the initial values, rather than the values at the time of
inheritance. As such, behavior no longer depends on whether
inheritance happens before or after a method has been called.

This is implemented by always keeping static_variables as the
original values, and static_variables_ptr as the modified copy.

Closes GH-6705.

show more ...

# 4b79dba9 09-Feb-2021 Dmitry Stogov

Added Inheritance Cache.

This is a new transparent technology that eliminates overhead of PHP class inheritance.

PHP classes are compiled and cached (by opcahce) separately, howeve

Added Inheritance Cache.

This is a new transparent technology that eliminates overhead of PHP class inheritance.

PHP classes are compiled and cached (by opcahce) separately, however their "linking" was done at run-time - on each request. The process of "linking" may involve a number of compatibility checks and borrowing methods/properties/constants form parent and traits. This takes significant time, but the result is the same on each request.

Inheritance Cache performs "linking" for unique set of all the depending classes (parent, interfaces, traits, property types, method types involved into compatibility checks) once and stores result in opcache shared memory. As a part of the this patch, I removed limitations for immutable classes (unresolved constants, typed properties and covariant type checks). So now all classes stored in opcache are "immutable". They may be lazily loaded into process memory, if necessary, but this usually occurs just once (on first linking).

The patch shows 8% improvement on Symphony "Hello World" app.

show more ...

# b3bbb8fe 19-Jan-2021 Dmitry Stogov

Mark classes cached by opcache by ZEND_ACC_CACHED flag and prevent useless copying and desrpoying of immutable data.

# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.

show more ...

# 7620ea15 03-Sep-2020 Nikita Popov

Don't intern compiled_filename

For php-ast interning the file name is an effective memory leak,
see php-ast#134.

I don't think there's any reason to do this. At some point this

Don't intern compiled_filename

For php-ast interning the file name is an effective memory leak,
see php-ast#134.

I don't think there's any reason to do this. At some point this
was needed due to bugs in the interned string mechanism that
caused issues if the string was later interned, e.g. through a
__FILE__ reference. These issues have since been resolved.

In conjunction with the filenames_table removal in c4016ecd446ef26bb3dc77735b6e441e151ea985
this means that filenames now need to be refcounted like normal
strings. In particular the filename reference in op_arrays and CEs
are refcounted.

show more ...

# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...

# 9bf11983 24-May-2020 Ilija Tovilo

Implement nullsafe ?-> operator

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

Closes GH-5619.

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

12345678910>>...18