Commit Graph

354 Commits

Author SHA1 Message Date
Dmitry Stogov
1b8916886b Speedup string equality check 2014-06-05 19:14:47 +04:00
Dmitry Stogov
0427ae08fb cleanup 2014-06-03 00:36:31 +04:00
Dmitry Stogov
e34a6e9211 Use new zend_hash API 2014-05-27 00:38:58 +04:00
Nikita Popov
4ee14c6f8d Fix ** operator with references 2014-05-26 18:17:55 +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
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
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
6f0f8511f2 Assert that EMPTY_SWITCH_DEFAULT_CASE() cannot be reached in debug 2014-05-22 19:00:25 +02:00
Anatol Belski
f089d63ddd C89 compat 2014-05-13 14:04:53 +02:00
Xinchen Hui
88c550a799 Added vstrpprintf strpprintf to avoid duplicate string
(the function name maybe improvement)
2014-05-10 00:21:49 +08:00
Nikita Popov
9343f874cd Fix identical comparison of arrays with references
Also commit a test I forgot.
2014-05-09 15:46:43 +02:00
Nikita Popov
42d4adabbd Fix SXE->string cast for __toString in inheriting class
This issue was originally hacked around in zend_make_printable_zval.
I've now moved the overridden __toString() handling into the SXE
cast_object handler, so everything invoking that handler
(zend_make_printable_zval, convert_to_string, zval_get_string,
and various other more obscure usages) see the same behavior.
2014-05-03 11:29:08 +02:00
Nikita Popov
d820ea9f5e Avoid superflous allocations in convert_to_string
Taken from zval_get_string.
2014-05-01 09:08:30 +02:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Nikita Popov
5db9312ec8 Add dst parameter to convert_object_to_type macro
Avoids a ZVAL_DUP in the zval_get_* functions.

Also improve object-to-array cast a bit by initializing the array
with correct number of elements and not doing a alloc-init-free
cycle when convert_object_to_type succeeds.
2014-04-25 23:21:05 +02:00
Nikita Popov
778946b3b6 Use convert_scalar_to_array only for arrays 2014-04-25 23:21:05 +02:00
Nikita Popov
93f9518a58 Align zval_get_long/double with zval_get_string 2014-04-25 23:21:04 +02:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Dmitry Stogov
5864ce8a44 Fixed compilation warnings 2014-04-22 17:46:34 +04:00
Dmitry Stogov
fa588a5c82 Use shorter call chain 2014-04-22 02:34:34 +04:00
Dmitry Stogov
4ed452c1b5 Convert zval_get_string() into "fast path" macro and "slow path" function 2014-04-21 22:36:01 +04:00
Dmitry Stogov
8ad8254a16 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-21 21:39:15 +04:00
Nikita Popov
0d43a277b8 Use zval_get_string in a few more places 2014-04-21 17:55:58 +02:00
Nikita Popov
5c8697184f Bring zval_get_string implement in line with make_printable_zval
As make_printable_zval is the "main" string cast, match that one.
2014-04-21 17:55:58 +02:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Nikita Popov
7a1a6092f6 Add functions for extracting long/double/string from zval
These function get the long / double / string value of a zval with
usual cast semantics, but without actually modifying the zval.

Didn't go on a killing spree for convert_to_* yet...
2014-04-15 20:32:47 +02:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Xinchen Hui
a0690ff288 Fixed zend_object_get_t in simpleXML 2014-04-15 11:05:03 +08:00
Nikita Popov
20f2e5986e Fix ZTS build
This only makes it compile, it doesn't actually work, presumably
because interned strings are assumed in some places.
2014-04-09 23:41:16 +02:00
Dmitry Stogov
76cc99fe60 Refactored ZVAL flags usage to simplify various checks (e.g. Z_REFCOUNTED(), candidate for GC, etc) 2014-04-03 15:26:23 +04:00
Dmitry Stogov
d8099d0468 Changed data layout to allow more efficient operations 2014-04-02 14:34:44 +04:00
Dmitry Stogov
a25a1ba0ef STR_DUP() doesn't duplicate interned strings anymore. In case new string is required STR_INIT() or STR_ALLOC() should be used. 2014-04-01 16:31:03 +04:00
Dmitry Stogov
54d559d893 Replaced (Z_TYPE(x) == IS_REFERENCE) with (Z_ISREF(x)) 2014-03-27 11:50:45 +04:00
Dmitry Stogov
b7938ab1bd Refactored GC (incomplete) 2014-03-19 17:00:28 +04:00
Dmitry Stogov
5f861768d6 Fixed reference conversion 2014-03-13 22:07:14 +04:00
Xinchen Hui
ecc0687398 Fixed IS_REFERENCE handling in sort() 2014-03-07 13:51:39 +08:00
Xinchen Hui
ef01b7937e Fixed wrong hash value in ext/standard/tests/array/array_combine.php 2014-03-05 18:39:20 +08:00
Xinchen Hui
dc889b69ef Fixed segfault (op2 maybe equal to result) 2014-03-05 15:43:57 +08:00
Dmitry Stogov
b965647e44 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Conflicts:
	Zend/zend_object_handlers.c
2014-02-25 15:23:06 +04:00
Xinchen Hui
f298ade89a Fixed wrong hash_zval_identical_function 2014-02-25 18:20:35 +08:00
Dmitry Stogov
820184dd00 Fixed converting IS_REFERENCE to string 2014-02-25 13:21:03 +04:00
Xinchen Hui
d35a068aa6 Fixed array comparation 2014-02-25 12:31:35 +08:00
Dmitry Stogov
760fe72af6 Fixed comparison od references 2014-02-24 17:29:28 +04:00
Dmitry Stogov
1770ace249 Fixed object to string conversion 2014-02-24 13:49:53 +04:00
Dmitry Stogov
844887ed56 Fixed IS_RESOURCE handling 2014-02-24 13:12:53 +04:00
Xinchen Hui
91e2a91396 Missing handling of IS_REF in ext/standard/tests/strings/bug47842.php 2014-02-23 19:36:38 +08:00
Dmitry Stogov
6454684212 Use better data structures (incomplete) 2014-02-21 22:59:51 +04:00
Dmitry Stogov
52bd62eca8 Fixed assertions 2014-02-21 20:35:40 +04:00