Commit Graph

202 Commits

Author SHA1 Message Date
Xinchen Hui
2d4186dde7 Use hash_exists_ind in symbol table 2016-03-02 12:11:13 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
0402f05ba3 Fixed possible crash on Zend/tests/bug71154.phpt 2015-12-21 15:57:53 +03:00
Xinchen Hui
6313e16a04 Improved fix for bug (count on symbol table) 2015-11-23 06:12:03 -08:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Dmitry Stogov
25f9e25526 Fixed bug #70187 (Notice: unserialize(): Unexpected end of serialized data) 2015-08-26 03:27:05 +03:00
Xinchen Hui
adf0e49912 zend_hash_resize seems useless, use zend_hash_extend 2015-08-13 12:19:35 +08:00
Xinchen Hui
16f2ce8537 Hmm, we should also take care of uninitialized hashTable 2015-08-10 17:58:24 +08:00
Xinchen Hui
be54eb7db1 Fixed bug #70211 (php 7 ZEND_HASH_IF_FULL_DO_RESIZE use after free) 2015-08-10 17:02:16 +08:00
Xinchen Hui
7d5fb7bbf3 Fixed bug #69674 (SIGSEGV array.c:953) 2015-07-29 10:46:12 +08:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Dmitry Stogov
869f662cdd Use better zend_hash_* functions 2015-06-05 13:54:57 +03:00
Xinchen Hui
0655abef1a Improve the fix for bug #69756 2015-06-05 18:42:21 +08:00
Dmitry Stogov
6c8d49b6b0 Improved hash table copying 2015-05-19 13:22:58 +03:00
Dmitry Stogov
ffe804a50c Use new hash iteration API. 2015-04-27 16:50:47 +03:00
Dmitry Stogov
ef36d8a91e Optimized zend_hash_rehash(), added some exoectations to generate better code 2015-04-24 13:00:56 +03:00
Dmitry Stogov
6265687768 Added HashTable flag HASH_FLAG_STATIC_KEYS that is maintaned to be set if all hash table keys are numbers or interned strings.
Take this flag into account when copy or destroy HashTable to avoud useless checks for each key.
2015-04-24 09:34:50 +03:00
Dmitry Stogov
770cb1da71 Keep realpath and PCRE caches in consistency with opcache SHM. 2015-04-22 02:29:06 +03:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Dmitry Stogov
4be8d798b6 Add some assumptions. 2015-03-24 12:22:11 +03:00
Anatol Belski
743541b311 fix datatype mismatch warnings 2015-03-19 22:33:12 +01:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
2b42d71908 Changed HashTable layout:
Removed HashTable->arHash (reduced memory consumption). Now hash slots may be accessed using HT_HASH() macro.
Hash slotas are allocated together with Buckets (before them) and lay in reverse order from HashTable->arData base address (see comments in Zend/zend_types.h)
Indexes in hash table and conflict resolution chains (Z_NEXT) may be stored as indeces or offsets in bytes, depending on system (32 or 64-bit).
HashTable data filelds are reordered to keep the most useful for zend_hash_find() data in the same CPU cache line.
2015-03-13 17:13:19 +03:00
Xinchen Hui
95b4aa5293 Fixed zend_hash_append result duplicated key
actually, maybe we should precalculate before calling zend_hash_appen
when we are not sure whether the hash is caclculated(prop_info->name).

but it looks a little ugly.. (also for zend_string_copy)
2015-03-08 00:21:02 +08:00
Xinchen Hui
28b408a242 Fixed bug #69198 (Compact function generate array with length but no content) 2015-03-07 16:49:07 +08:00
Bob Weinand
b4a142ab97 Added yield from operator 2015-03-07 00:28:12 +01:00
Dmitry Stogov
9f9ffdd0a0 Use fast zend_hash_append() API 2015-03-06 19:23:54 +03:00
Dmitry Stogov
6dfff52f61 Improved method inhereitance code and cleanup 2015-03-05 02:10:38 +03:00
Dmitry Stogov
c9bd24de7a Improved ineritance code 2015-03-04 23:06:07 +03:00
Dmitry Stogov
8ec8648c91 Improved code for class property inheritance 2015-03-04 17:41:01 +03:00
Xinchen Hui
2702739ceb Merge branch 'master' of https://git.php.net/repository/php-src 2015-03-03 18:16:46 +08:00
Xinchen Hui
70bd500645 Fixed #69166 (Assigning array_values() to array does not reset key counter) 2015-03-03 17:31:20 +08:00
Dmitry Stogov
b7f4f48b9e Strength reduction 2015-03-02 23:46:28 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Dmitry Stogov
97fe15db43 Fix "forech" statemt behaviour according to https://wiki.php.net/rfc/php7_foreach
Squashed commit of the following:

commit 1e41295097
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Jan 31 07:28:58 2015 +0300

    Generalize HashTableIterator API to allows its usage without involvement of HashTable.nInternalPonter

commit 5406f21b11
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:43 2015 +0300

    Reduced alghorithms complexity

commit b37f1d58d2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:30 2015 +0300

    Fixed test name

commit fb2d079645
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:05 2015 +0300

    API cleanup

commit 08302c0d6d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 14:20:46 2015 +0300

    Make array_splice() to preserve foreach hash position

commit cc4b7be41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 12:24:31 2015 +0300

    Make internal function, operation on array passed by reference, to preserve foreach hash position

commit 5aa9712b0a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 09:49:35 2015 +0300

    Implement consistent behavior for foreach by value over plain object

commit 4c5b385ff5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 07:56:37 2015 +0300

    More careful iterators update.

commit 721fc9e80d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:43:28 2015 +0300

    Added new test

commit 15a23b1218
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:05:02 2015 +0300

    Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details)

commit 10a3260b1f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:04:44 2015 +0300

    New test

commit eef80c5837
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 16:52:21 2015 +0300

    Fixed foreach by reference iteration over constant array

commit 61e7391873
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 14:59:54 2015 +0300

    Fixed temporary variable re-allocation pass

commit 92e90c09f0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 12:44:57 2015 +0300

    Fixed operand destruction in case of exceptions in iterator

commit dd2a36a207
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 10:02:34 2015 +0300

    Use GET_OP1_ZVAL_PTR_DEREF() (IS_TMP_VAR and IS_CONST can't be IS_REFERENCE)

commit 4638f7b914
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 07:43:28 2015 +0300

    Change "foreach" statement behavior (this is just a PoC yet)

    - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy.

    - it makes no difference if array given to "foreach by value" is reference itself

    - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented)
2015-02-12 13:57:12 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
2193de0d18 Faster sorting algo 2015-01-14 18:02:41 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Dmitry Stogov
37466b0368 Use special flag (HASH_FLAG_INITIALIZED) instead of (nTableMask == 0) to indicate that HashTable is allocated.
Make nTableMask to be 0 for packed arrays.
Remove checks fo HASH_FLAG_PACKED in zend_hash_find/zend_hash_del and family (string keys are resolved through uninitialized_bucket).
Change HashTable layout for better locality.
2014-12-27 11:07:12 +03:00
Nikita Popov
2d212b426a Drop duplicate arg from hash_get_current_key_ex 2014-12-26 21:06:18 +01:00
Dmitry Stogov
106b1017d4 API for fast construction of packed arrays 2014-12-23 19:08:28 +03:00
Xinchen Hui
62e2973602 Revert "Improve Hash foreach macros"
This reverts commit 95bb0a0f7a.
2014-12-23 03:51:06 -05:00
Xinchen Hui
95bb0a0f7a Improve Hash foreach macros 2014-12-23 00:50:39 -05:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Dmitry Stogov
3727e26456 Improved zend_hash_clean() and added new optimized zend_symtable_clean() 2014-11-25 14:17:21 +03:00
Dmitry Stogov
ab7b38e336 Added new optimized zend_array_destroy() function 2014-11-25 12:58:29 +03:00
Bob Weinand
47fd168fed Move missing zend_hash_* macros from phpdbg.h to zend_hash.h 2014-10-28 23:07:36 +01:00
Dmitry Stogov
2a1250fa57 Micro optimization for zend_hash_next_index_insert_new() 2014-10-16 19:19:10 +04:00
Dmitry Stogov
ed18d67c5e Fixed bug #68215 (Behavior of foreach has changed) 2014-10-15 17:02:54 +04:00