Commit Graph

8590 Commits

Author SHA1 Message Date
Dmitry Stogov
e499c3d259 Introduced new BIND_GLOBAL instraction instead of FETCH_W+ASSIGN_REF pair that caused a lot of useles checks 2014-06-06 15:04:30 +04:00
Dmitry Stogov
e4581fd6b8 GC doesn't count scalars and immutable arrays in the same way 2014-06-05 21:05:07 +04:00
Dmitry Stogov
1b8916886b Speedup string equality check 2014-06-05 19:14:47 +04:00
Dmitry Stogov
730beec16e Simplify code 2014-06-05 18:42:17 +04:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Dmitry Stogov
3d87391cc0 Reference counters in PHPNG may have different values 2014-06-04 09:57:17 +04:00
Dmitry Stogov
6e7338700e Avoid useless merge 2014-06-04 02:11:26 +04:00
Dmitry Stogov
3f6f0d5a70 Simplified and optimized ZEND_HANDLE_NUMERIC() 2014-06-03 13:10:42 +04:00
Dmitry Stogov
bc2ba841f9 Optimized conditions order 2014-06-03 09:45:09 +04:00
Dmitry Stogov
30c05577f7 Optimized conditions order 2014-06-03 03:54:03 +04:00
Dmitry Stogov
af78ea1d97 Avoid copying of immutable arrays 2014-06-03 02:43:53 +04:00
Dmitry Stogov
2bc1abe204 cleanup 2014-06-03 02:43:31 +04:00
Dmitry Stogov
0427ae08fb cleanup 2014-06-03 00:36:31 +04:00
Dmitry Stogov
032bdbba73 Improved conditions order 2014-05-30 14:40:19 +04:00
Dmitry Stogov
d2020cd91b Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  typo
  Revert "Fix ArrayObject with immutable array"
  Fix ArrayObject with immutable array
2014-05-30 11:13:19 +04:00
Dmitry Stogov
984c8f87d2 Avoid useless duplication of immutable arrays 2014-05-30 11:12:24 +04:00
Xinchen Hui
9f70b2f6fa typo 2014-05-30 14:56:50 +08:00
Dmitry Stogov
b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Nikita Popov
47e85b1b35 Improve class constant fetch fix
Dereference the cached constant for Test::TEST as well (and not just
self::TEST).

Also improve the phpt file to test this case as well - previously
this only manifested with opcache enabled, due to literal sharing.

Additionally the Z_TYPE_P != IS_REFERENCE assertion is now moved
into the TMP_VAR fetching code (as it applies to more than just
property assignments.)
2014-05-29 11:17:33 +02:00
Nikita Popov
d9a35c7e97 Fix class constant fetching
If a class is extended after the constant fetch has been cached
the cached value will be turned into a reference. On the next
fetch the polymorphic cache will return this reference, which
will be directly returned. The object assignment code then
dereferences this result and performs a shallow copy, which is
invalid for references. This subsequently leads to the constant
value being prematurely freed.

This is fixed by dereferencing the value returned from the
polymorphic cache. Furthermore the incorrect dereference from
in the object assignment code is replaced with an assertion that
we're dealing with a non-reference, so ensure that this kind of
problem cannot go unnoticed in the future.
2014-05-29 00:15:50 +02:00
Nikita Popov
411a8757ad Initialize GC_TYPE_INFO for EG(symbol_table) 2014-05-29 00:15:50 +02:00
Dmitry Stogov
d0d62d3bb0 Use new zend_hash API 2014-05-28 18:45:01 +04:00
Xinchen Hui
1966116791 retval's initializing is already taken by zend_call_function 2014-05-27 17:48:34 +08:00
Dmitry Stogov
e34a6e9211 Use new zend_hash API 2014-05-27 00:38:58 +04:00
Dmitry Stogov
05d0df4706 Use new zend_hash API 2014-05-26 21:29:35 +04:00
Nikita Popov
4ee14c6f8d Fix ** operator with references 2014-05-26 18:17:55 +02:00
Nikita Popov
ff72c7bfd7 Add test for previous commit 2014-05-26 18:13:16 +02:00
Nikita Popov
ec7b5e0b19 Fix incdec of ref object properties
This fixes a number of infinite loops in the Symfony testsuite. It
took an obscene amount of time to track this down :/
2014-05-26 18:00:15 +02:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Dmitry Stogov
22f6cf91d5 Optimize func_get_args() to build packed array 2014-05-26 17:15:52 +04:00
Xinchen Hui
b5f90e5103 Save some unnecessary zval copying 2014-05-26 17:25:57 +08:00
Xinchen Hui
bd4b9837e9 Improve call_user_function performance
params are all zval * now, and retval will be initialized in
zend_call_function.

maybe we can make call_user_function as a macro proxy to
call_user_function_ex later.
2014-05-26 17:16:22 +08:00
Dmitry Stogov
b66728aabb Removed useless initializations 2014-05-26 11:42:58 +04:00
Xinchen Hui
066c1d5451 This seems better 2014-05-26 12:05:21 +08:00
Xinchen Hui
02fde346f8 Save one zval copy 2014-05-26 11:49:43 +08:00
Xinchen Hui
922285ec55 Don't use cast (compiler friendly) 2014-05-26 11:05:04 +08:00
Nikita Popov
0ade00c844 Fix print_flat_hash for objects 2014-05-25 20:07:29 +02:00
Nikita Popov
6714770d83 Fix ZTS build 2014-05-25 18:11:24 +02:00
Xinchen Hui
bc357eaf3f Fixed apply_func_args_t 2014-05-25 20:04:35 +08:00
Xinchen Hui
0175d994c0 Fixed apply_func_arg_t, and it's better not using cast (compiler friendly) 2014-05-25 19:56:51 +08:00
Xinchen Hui
c2082ece52 Fixed apply_func_t (they should be broken before) 2014-05-25 18:32:35 +08:00
Xinchen Hui
00e69ba164 typo 2014-05-24 21:45:07 +08:00
Xinchen Hui
b87cff66b8 fci->retval is always set 2014-05-24 21:37:15 +08:00
Xinchen Hui
60e01e5d64 Added folder mark and codes style 2014-05-24 21:35:36 +08:00
Dmitry Stogov
9eb89dddb1 Use optimized zend_array_dup() function. convert zend_hash_num_elements() and zend_hash_next_free_element() into macros. 2014-05-23 20:37:53 +04:00
Nikita Popov
c838f6c5b9 Remove UB in signed printing macro
Signed->unsigned conversion and unsigned negation are well-defined
(unlike signed negation for LONG_MIN.)
2014-05-23 13:15:08 +02:00
Nikita Popov
1d8c499b51 Optimize int to string conversion
Probably platform depedentant, but for me snprintf is terribly
slow.

The code for the long printing is taken from the smart string
API.
2014-05-23 13:10:50 +02:00
Nikita Popov
4778586896 Fix typo 2014-05-22 19:00:25 +02:00
Nikita Popov
6f0f8511f2 Assert that EMPTY_SWITCH_DEFAULT_CASE() cannot be reached in debug 2014-05-22 19:00:25 +02:00
Dmitry Stogov
21da8af578 Removed the old hack that was originally developed to support constants in array indeces, and isn't needed anymore after the Bob's patch. 2014-05-19 01:20:56 +04:00