Commit Graph

131 Commits

Author SHA1 Message Date
Dmitry Stogov
d510255879 Rename IS_ERROR into _IS_ERROR (to prevent redefinition on Windows). 2016-02-01 11:12:28 +03:00
Dmitry Stogov
86f54fcdf7 Use special type IS_ERROR instread of EG(error_zval). (we still need EG(error_zval) for SPL support). 2016-01-28 18:00:06 +03:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Nikita Popov
65e456f364 Introduce BIND_LEXICAL
This opcodes inserts a local CV into the closure static variable
table. This replaces the previous mechanism of having static
variables marked as LEXICAL, which perform a symtable lookup
during copying.

This means a) functions which contain closures no longer have to
rebuild their symtable (better performance) and b) we can now track
used variables in SSA.
2015-12-29 23:14:53 +01:00
Xinchen Hui
3ed5e54a19 Remove unused IS_TYPE_SYMBOLTABLE 2015-12-16 12:11:55 +08:00
Dmitry Stogov
a75c195000 Implemented the RFC Support Class Constant Visibility.
Squashed commit of the following:

commit f11ca0e7a5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:38:42 2015 +0300

    Fixed test expectation

commit 211f873f54
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Dec 8 12:28:38 2015 +0300

    Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags

commit 51deab84b2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Dec 7 11:18:55 2015 +0300

    Fixed issues found by Nikita

commit 544dbd5b47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Dec 5 02:41:05 2015 +0300

    Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility
    @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
2015-12-08 12:40:42 +03:00
Andrea Faulds
366ba41334 Add void return type 2015-11-18 17:30:49 +00:00
Dmitry Stogov
c49d3189b1 Cleanup: removed comments (zend_object.handle and zend_resource.handle are not going to be removed in PHP-7.0) 2015-09-22 15:56:52 +03:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Xinchen Hui
66866fb838 Simplify the macro (HT_DATA_SIZE/HT_HASH_SIZE is not used outside Zend) 2015-08-13 23:38:39 +08:00
Dmitry Stogov
715d5d2855 Get rid of implicit type casting in GC_*() macros in Zend/zend_types.h.
This prevented compilation warnings and disclosed few incorrect usages in Zend/zend_vm_def.h and ext/dom/xpath.c.
Now explicit type casting may be required on call site.
This may break some C extension code, but it shoulfn't be a problem to add explicit casting.
2015-08-13 13:56:29 +03:00
Xinchen Hui
a089ce0cc6 Fixed bug #70258 and #70253 2015-08-13 12:08:57 +08:00
Xinchen Hui
89940993f0 Fixed Bug #70173 (ZVAL_COPY_VALUE_EX broken for 32bit Solaris Sparc) 2015-08-10 22:58:58 +08:00
Christoph M. Becker
79f64e5e67 Fix #70173: ZVAL_COPY_VALUE_EX broken for 32bit Solaris Sparc
On 32bit big endian architectures the high word of a zend_value is copied
twice, instead of copying both words. Let's fix it.
2015-08-09 15:01:37 +02:00
Anatol Belski
859507c9af add one more thread storage specifier to allow external link 2015-07-29 17:26:52 +02:00
Anatol Belski
5c98b9972f improve ZEND_TLS declaration even more and move it to the better place 2015-07-28 16:59:53 +02:00
Xinchen Hui
95ff2852ee Micro optimization 2015-07-10 16:39:21 +08: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
Xinchen Hui
dc329cd5dc Make the tail slash algined 2015-06-16 11:33:44 +08:00
Dreamsxin
73031d92ce Fix invalid conversion about emalloc 2015-06-16 11:12:37 +08:00
Dmitry Stogov
8a089e7e71 Call zend_array_dup() instead of zval_copy_ctor(). 2015-06-02 12:03:34 +03:00
Dmitry Stogov
1654442ac3 Fixed integer overflow during HashTable size calculation 2015-06-01 10:51:06 +03:00
Nikita Popov
f3dde29394 Fixes for x32 ABI
I'm assuming that we want to have 64bit zend_longs on x32 here.

This fixes two typos in __x86_64__ macros and adds sign-extension
when assigning STREAM_COPY_ALL to zend_long.
2015-05-23 21:18:33 +02:00
Dmitry Stogov
d72a94468e Merged FE_FETCH_R[W] with the following ASSIGN[_REF] when assigne to CV. 2015-05-13 12:55:42 +03:00
Dmitry Stogov
6718b56e45 Change the GC approach to inner-loops handling. Switch to less efficient but more robust algorithm. Destructors handling is still not completely accurate. 2015-04-17 18:35:57 +03:00
Dmitry Stogov
276080ec3a Added GC checks and improvements 2015-04-17 03:55:37 +03:00
Dmitry Stogov
9806a62545 GC improved to support inner-cycles. 2015-04-14 00:16:27 +03:00
Dmitry Stogov
dcaa79546b Don't relay on reference-counter when parameter expected to be a reference, but value given. 2015-04-03 16:35:06 +03:00
Xinchen Hui
d7835ee224 Using int32_t opposite of uint32_t 2015-03-31 12:40:29 +08:00
Anthony Ferrara
d22bfb8aa6 Merge in master, fix merge conflicts and update patch to support exceptions everywhere 2015-03-18 10:50:11 -04:00
Dmitry Stogov
4e11095438 Reimplemented special constant handling. Now __HALT_COMPILER_OFFSET__ is resolved at compile-time. __CLASS__ retrived using separate ZEND_FETCH_CLASS_NAME opcode. 2015-03-18 15:33:56 +03:00
Dmitry Stogov
55da1fb008 Fixed zend_hash_del() 2015-03-17 23:13:39 +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
Anthony Ferrara
dc35868a77 Merge branch 'master' into scalar_type_hints_v5 2015-02-20 13:33:35 -05:00
Dmitry Stogov
d85113702c Lazy duplication of op_array->static_variables 2015-02-20 13:28:26 +03:00
Anthony Ferrara
9109e48749 Merge in master 2015-02-18 10:35:39 -05: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
12abac8bb7 Limit HashTable size to avoid integer overflow checks 2015-02-13 02:12:42 +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
Andrea Faulds
cc01e37e54 It Begins 2015-02-10 15:48:06 +00:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +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
Dmitry Stogov
ab0b15b8ff Optimized destruction of extra arguments passed to user functions.
If no refcounted arguments are passed, then destruction code is not triggered at all.
(Full rebuild required)
2014-12-26 22:34:44 +03:00
Anatol Belski
61f90fbe0b Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Save 8 bytes on 64 bits

Conflicts:
	Zend/zend_API.c
2014-12-15 07:13:09 +01:00
Xinchen Hui
8f177fde90 Save 8 bytes on 64 bits 2014-12-15 00:43:28 -05:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00