Commit Graph

189 Commits

Author SHA1 Message Date
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
Anatol Belski
e33e4b2d8c int to size_t where the underlaying API supports it 2014-10-10 19:00:20 +02:00
Xinchen Hui
aa5f937958 It should be in extern c 2014-10-03 18:35:57 +08:00
Dmitry Stogov
1e0e1b4a73 Split big _zend_handle_numeric_str() into small always inlined function that makes initial check and regular big function 2014-09-18 18:50:05 +04:00
Dmitry Stogov
5185baab3e Changed "inline" into "zend_always_inline" 2014-09-18 04:59:01 +04:00
Nikita Popov
543ae3f029 Drop BC alias HASH_NON_EXISTANT 2014-09-16 18:29:00 +02:00
Nikita Popov
311a67a2ed Remove HASH_NEXT_INSERT flag
We already pass ht->nNextFreeElement and the rest is handled by
ZEND_HASH_ADD.
2014-09-16 18:29:00 +02:00
Dmitry Stogov
6991780793 Optimized FE_RESET and FE_FETCH 2014-09-16 01:34:27 +04:00
Nikita Popov
ca43b99fc6 Update types in zend_hash
* String lengths are size_t
 * Indexes are uint32_t
 * Flags are uint32_t
 * Booleans are zend_bool
2014-09-15 23:07:31 +02:00
Nikita Popov
d2a3bf9daf Fix compiler warnings 2014-08-25 23:08:01 +02:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00