#
d8940807 |
| 13-Jan-2023 |
Arnaud Le Blanc |
Merge branch 'PHP-8.1' into PHP-8.2 * PHP-8.1: Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242) GC fiber unfinished executions (#9810)
|
#
0f7625c4 |
| 13-Jan-2023 |
Arnaud Le Blanc |
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242) zend_hash allocates a hash table twice as big as nTableSize (HT_HASH_SIZE(HT_SIZE_TO_MASK(nTableSize)) == nTableSize
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242) zend_hash allocates a hash table twice as big as nTableSize (HT_HASH_SIZE(HT_SIZE_TO_MASK(nTableSize)) == nTableSize*2), so HT_MAX_SIZE must be half the max table size or less. Fixes GH-10240
show more ...
|
#
bccda7eb |
| 01-Aug-2022 |
Arnaud Le Blanc |
Extended map_ptr before copying class table (#9188) Fixes GH-9164 |
#
a6970838 |
| 01-Aug-2022 |
Arnaud Le Blanc |
Extended map_ptr before copying class table (#9188) Fixes GH-9164 |
#
4457dba1 |
| 22-Jul-2022 |
George Peter Banyard |
Add support for stubs to declare intersection type class properties (#8751) |
#
b40ae808 |
| 07-Jun-2022 |
George Peter Banyard |
Convert iterable into an internal alias for Traversable|array (#7309) This does a compile time transformation of ``iterable`` into ``Traversable|array`` which simplifies some of the LSP vari
Convert iterable into an internal alias for Traversable|array (#7309) This does a compile time transformation of ``iterable`` into ``Traversable|array`` which simplifies some of the LSP variance handling. The arginfo generation script from stubs is updated to produce a union type when it encounters the type ``iterable`` Extension functions which do not regenerate the arginfo, or write them manually are still supported by mimicking the compile time transformation while registering the function. Type Reflection is preserved for single ``iterable`` (and ``?iterable``) to produce a ReflectionNamedType with name ``iterable``, however usage of ``iterable`` in union types will be converted to ``array|Traversable``
show more ...
|
#
d56ec0a6 |
| 17-Nov-2021 |
Dmitry Stogov |
Merge branch 'PHP-8.1' * PHP-8.1: Fixed bug #81607 (CE_CACHE allocation with concurrent access)
|
#
76548e50 |
| 17-Nov-2021 |
Dmitry Stogov |
Fixed bug #81607 (CE_CACHE allocation with concurrent access) |
#
d362caed |
| 15-Nov-2021 |
Nikita Popov |
Merge branch 'PHP-8.1' * PHP-8.1: Fix generation of property with class union type Replace SKIPIF with EXTENSIONS
|
#
68ca3879 |
| 15-Nov-2021 |
Nikita Popov |
Fix generation of property with class union type The generated type was missing the UNION bit. Add a ZEND_TYPE_INIT_UNION macro to hide the implementation details. |
#
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 ...
|
#
bd3e5363 |
| 08-Oct-2021 |
Nikita Popov |
Fixed bug #81514 Objects reuse the GC_PERSISTENT flag as IS_OBJ_WEAKLY_REFERENCED, which we did not account for in ZVAL_COPY_OR_DUP. To make things worse the incorrect zval_copy_ctor
Fixed bug #81514 Objects reuse the GC_PERSISTENT flag as IS_OBJ_WEAKLY_REFERENCED, which we did not account for in ZVAL_COPY_OR_DUP. To make things worse the incorrect zval_copy_ctor_func() invocation silently did nothing. To avoid that, add an assertion that it should only be called with arrays and strings (unlike the normal zval_copy_ctor() which can be safely called on any zval).
show more ...
|
#
14f599ea |
| 31-Aug-2021 |
Nikita Popov |
Use zend_long for resource ID Currently, resource IDs are limited to 32-bits. As resource IDs are not reused, this means that resource ID overflow for long-running processes is very
Use zend_long for resource ID Currently, resource IDs are limited to 32-bits. As resource IDs are not reused, this means that resource ID overflow for long-running processes is very possible. This patch switches resource IDs to use zend_long instead, which means that on 64-bit systems, 64-bit resource IDs will be used. This makes resource ID overflow practically impossible. The tradeoff is an 8 byte increase in zend_resource size. Closes GH-7436.
show more ...
|
#
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 ...
|
#
fb52b3c9 |
| 28-Jul-2021 |
George Peter Banyard |
[skip-ci] Fix comments and UPGRADING.INTERNALS for zend_type changes |
#
7572d9bd |
| 20-Jul-2021 |
Nikita Popov |
Fix RC_DEBUG check for IS_NULL type IS_NULL is set during GC, conservatively assume that it might have been an object. |
#
069a9fa5 |
| 05-Jul-2021 |
George Peter Banyard |
Pure Intersection types (#6799) Implement pure intersection types RFC RFC: https://wiki.php.net/rfc/pure-intersection-types Co-authored-by: Nikita Popov <nikic@php.net>
Pure Intersection types (#6799) Implement pure intersection types RFC RFC: https://wiki.php.net/rfc/pure-intersection-types Co-authored-by: Nikita Popov <nikic@php.net> Co-authored-by: Ilija Tovilo <ilutov@php.net>
show more ...
|
#
e11468a7 |
| 07-Jun-2021 |
Nikita Popov |
Remove ZVAL_NEW_ARR() macro This macro is a footgun because it creates an uninitialized array (only an allocation). This macro is no longer used in php-src, and we have better altern
Remove ZVAL_NEW_ARR() macro This macro is a footgun because it creates an uninitialized array (only an allocation). This macro is no longer used in php-src, and we have better alternatives like array_init() or ZVAL_ARR(arr, zend_new_array(size_hint)).
show more ...
|
#
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. |
#
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 ...
|
#
d8e4fbae |
| 08-Apr-2021 |
Dmitry Stogov |
Fast Class Cache This is generalization of idea, that was previously usesd for caching resolution of class_entries in zend_type. Now very similar mechanizm is used for general zend_s
Fast Class Cache This is generalization of idea, that was previously usesd for caching resolution of class_entries in zend_type. Now very similar mechanizm is used for general zend_string into zend_class_entry resolution. Interned zend_string with IS_STR_CLASS_NAME_MAP_PTR GC_FLAG uses its refcount to adress corresponding zend_class_entry cache slot. The refcount keeps an offset to this slot from CG(map_ptr_base). Flag may be checked by ZSTR_HAS_CE_CACHE(str), cache slot may be read by ZSTR_GET_CE_CACHE(str) and set by ZSTR_SET_CE_CACHE(str, ce).
show more ...
|
#
353f7ffb |
| 16-Feb-2021 |
Nikita Popov |
Delref only after successful allocation Otherwise we may have inconsistent refcounts after OOM. I expect this problem is much more prevalent, but this at least fixes some string
Delref only after successful allocation Otherwise we may have inconsistent refcounts after OOM. I expect this problem is much more prevalent, but this at least fixes some string/array separation cases. Fixes oss-fuzz #30999.
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 ...
|
#
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 ...
|
#
ec58a6f1 |
| 14-Jan-2021 |
Nikita Popov |
Remove SEPARATE_ZVAL_IF_NOT_REF() macro This macro hasn't made sense since PHP 7. The correct pattern to use is ZVAL_DEREF + SEPARATE_ZVAL_NOREF. |