History log of /php-src/ext/opcache/zend_file_cache.c (Results 1 – 25 of 203)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# f2e199e8 25-Feb-2024 Máté Kocsis

Implement "support doc comments for internal classes and functions" (#13266)

Fixes #13130


# 49ebfb04 07-Feb-2024 Ilija Tovilo

Fix JMP_FRAMELESS with ZEND_USE_ABS_JMP_ADDR

which is used on 32-bit machines.


# 90f2e760 11-Oct-2023 Sergei Turchanov

Reset inheritance_cache pointer of zend_class_entry upon serialization (#12401)

to opcache filecache. Usually, when a class is being loaded, a dependency
tracking is performed after the

Reset inheritance_cache pointer of zend_class_entry upon serialization (#12401)

to opcache filecache. Usually, when a class is being loaded, a dependency
tracking is performed after the call to zend_file_cache_script_store.
But sometimes, when opcache cache is empty and there are many simultaneous
outstanding requests for compilation, some classes do have their
inheritance_cache initialized before the call to zend_file_cache_script_store,
and in that case this pointer is serialized as-is. And when such a class
is loaded from opcache filecache this pointer also loaded as-is, and now
it points to some random location in memory. This causes segfaults occuring
when traversing inheritance_cache of such classes.

We need to reset inheritance_cache pointer of zend_class_entry
upon serialization. This should have been done anyway since it is a sensible
strategy to sanitize any memory pointer upon serialization (either by calling
SERIALIZE_x macros or setting to NULL or any other deterministic value).

show more ...


# 35862641 02-Aug-2023 Ilija Tovilo

Unpoison opcache mem buf for file cache checksum calc

The buffer may contain uninitialized bytes, like padding, zval.value for
IS_TRUE, IS_NULL, etc. and other unused fields. The checksu

Unpoison opcache mem buf for file cache checksum calc

The buffer may contain uninitialized bytes, like padding, zval.value for
IS_TRUE, IS_NULL, etc. and other unused fields. The checksum calculation loops
over all bytes and thus will trigger uninitialized reads in MSAN. It doesn't
matter too much, as the bytes in the file will still match the checksum.

show more ...


# b2dbf0a2 31-Jul-2023 Ilija Tovilo

Remove opcache.consistency_checks

This feature has been broken at least since the tracing JIT and inheritance
cache have been introduced. The attempted fix (GH-10798) was too complex. We

Remove opcache.consistency_checks

This feature has been broken at least since the tracing JIT and inheritance
cache have been introduced. The attempted fix (GH-10798) was too complex. We
have thus decided to remove this feature for now.

Closes GH-11832

show more ...


# 3e9792f4 27-Jul-2023 Mikhail Galanin

Check if restart is pending before trying to lock SHM

This reduces lock contention when Opcache restart is scheduled
but not yet started.

Closes GH-11805


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


# 414f71a9 16-Apr-2023 Máté Kocsis

Typed class constants (#10444)

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

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <31

Typed class constants (#10444)

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

Co-Authored-By: Ben <7127204+moliata@users.noreply.github.com>
Co-Authored-By: Bob Weinand <3154871+bwoebi@users.noreply.github.com>
Co-Authored-By: Ilija Tovilo <ilija.tovilo@me.com>

show more ...


# 413844d6 18-Feb-2023 Max Kellermann

Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)

These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in

Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)

These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in main/php.h.

show more ...


# c8955c07 16-Jan-2023 Christoph M. Becker

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07f7371ee2b5fac17de147926780e427fae6.
This reverts commit f377e15751d3aa48b69cd9bcc366ede7803d511f.
This reverts commit b4ba16fe189b109144aff669e11d81365160104b.
This reverts commit 694ec1deea36e366b28b6349a52be49824e1a1a8.
This reverts commit 6b34de8eba9f66882ae16e6073af28783670ac53.
This reverts commit aa1cd02a4367834026ea2205ea13a2f904455aa1.
This reverts commit 308fd311ea6fcf3094b448df7f2b264f08e4fe4f.
This reverts commit 16203b53e1822a37b6ba6f2ab198bb435d05fdad.
This reverts commit 738fb5ca5412f5e833a7fab82b11519e635a3357.
This reverts commit 9fdbefacd3c382d731aa175b7bdc002ec9cb2b30.
This reverts commit cd4a7c1d90562ebb5f89caf94d00d579631b9fbe.
This reverts commit 928685eba2b2f0ded90e7f78fd806ea164002f6e.
This reverts commit 01e5ffc85cd4357fd7b5b7ceefa29f2d10ca26b7.

show more ...


# 308fd311 04-Jan-2023 Max Kellermann

ext/{standard,json,random,...}: add missing includes


# 3daa8a93 22-Sep-2022 Ilija Tovilo

Fix default_object_handlers pointing to invalid memory with file_cache

Closes GH-9596


# ea1287b0 03-Sep-2022 Arnaud Le Blanc

Log the cause of error when opcache cannot write to file cache (#9258)


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
# ddc0b490 10-Mar-2022 Ilija Tovilo

Allow arbitrary const expressions in backed enums

Closes GH-7821
Closes GH-8190
Closes GH-8418

# 04a4864b 24-Mar-2022 Max Kellermann

ext/opcache: merge redundant code and "bool" refactoring (#8237)

* ext/opcache/ZendAccelerator: make check_persistent_script_access() static

* ext/opcache/ZendAccelerator: convert "

ext/opcache: merge redundant code and "bool" refactoring (#8237)

* ext/opcache/ZendAccelerator: make check_persistent_script_access() static

* ext/opcache/ZendAccelerator: convert "int" to "bool"

* ext/opcache/zend_file_cache: convert "int" to "bool"

* ext/opcache: use true/false for zend_persistent_script.corrupted

* ext/opcache/ZendAccelerator: move duplicate code to zend_accel_discard_script()

* ext/opcache/ZendAccelerator: convert accel_deactivate_now() to function

Simplify the #iddef ZEND_WIN32.

* ext/opcache/zend_file_cache: simplify iovec initializer

* ext/opcache/zend_file_cache: add local zend_string* variables

Eliminates lots of redundant casts and avoids reloading the variable
from RAM into registers.

* ext/opcache/zend_file_cache: use ZSTR_VAL()

* ext/opcache/zend_file_cache: move code to zend_file_cache_script_write()

This eliminates duplicate error handling code.

show more ...

# 63281763 18-Mar-2022 Max Kellermann

ext/opcache/zend_shared_alloc: add zend_shared_alloc_aligned()

Eliminate some duplicate code.

Revision tags: 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 ...

Revision tags: php-8.0.14, php-8.1.1, php-7.4.27, php-8.1.1RC1, php-8.0.14RC1
# 024d5f4b 01-Dec-2021 Tyson Andre

Cache method overrides of ArrayAccess in zend_class_entry

Previously, code such as subclasses of SplFixedArray would check for method
overrides when instantiating the objects.

T

Cache method overrides of ArrayAccess in zend_class_entry

Previously, code such as subclasses of SplFixedArray would check for method
overrides when instantiating the objects.

This optimization was mentioned as a followup to GH-6552

show more ...

Revision tags: php-7.4.27RC1, php-8.1.0, php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6
# 90b7bde6 03-Nov-2021 Dmitry Stogov

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.

show more ...

Revision tags: php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12
# ddaf64b5 14-Oct-2021 Dmitry Stogov

Avoid non-immutable map_ptr indirection

Revision tags: 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, php-7.4.24, php-7.3.31, 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
# ba8e5d33 18-Aug-2021 Nikita Popov

Merge branch 'PHP-8.0'

* PHP-8.0:
Test file_cache prime shm + use file combination
Fix repeated file cache unserialization of zval string


# de7ba3e7 18-Aug-2021 Nikita Popov

Fix repeated file cache unserialization of zval string

The IS_UNSERIALIZED check here does not work if the string is
interned (serialized with file_cache_only=0) but unserialization

Fix repeated file cache unserialization of zval string

The IS_UNSERIALIZED check here does not work if the string is
interned (serialized with file_cache_only=0) but unserialization
happens with file_cache_only=1. In this case the unserializde
string will be in the str area after mem, which is not included
in the script size, and which is also not accessible at this
point without threading through more information. Work around
the problem by checking for the serialized representation instead.

show more ...

# e86a0a90 17-Aug-2021 Nikita Popov

Assert that file cache does not contain references

Revision tags: php-8.1.0beta3
# 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 ...

123456789