Commit Graph

698 Commits

Author SHA1 Message Date
Dmitry Stogov
412ad4b254 Uinified call frame handling for user and internal functions.
Now EG(current_execute_data) always point to the call frame of the currently executed function.
2014-07-02 22:01:25 +04:00
Dmitry Stogov
d6bd21eab2 Use fast comparison for (func->type == ZEND_USER_FUNCTION || func->type == ZEND_EVAL_CODE) 2014-06-27 13:02:49 +04:00
Dmitry Stogov
032f33591a Keep extra args in the same VM stack segment (after all CV and TMP vars) 2014-06-27 12:25:36 +04:00
Dmitry Stogov
c69781393c Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single copy of each argument on VM stack (previously ZE kept two copies of each arguments for user functions) 2014-06-26 23:51:14 +04:00
Dmitry Stogov
43477bc7a2 Refactoring: use call_frames instead of call_slots 2014-06-24 02:17:16 +04:00
Dmitry Stogov
bbc508dea5 Fixed string deallocation and code cleanup 2014-06-23 17:01:59 +04:00
Dmitry Stogov
bd10db271c Use new zend_hash iteration API 2014-06-16 21:11:52 +04:00
Dmitry Stogov
14e6ee7f42 Use absolute addresses as branch targets for NEW, FE_RESET and FE_FETCH 2014-06-11 11:39:42 +04:00
Xinchen Hui
ebe6854dbc Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_execute_API.c
2014-06-10 21:58:16 +08:00
Xinchen Hui
e8699d75da Remove unused included file 2014-06-10 21:56:30 +08:00
Xinchen Hui
3c69140a90 Remove unused codes 2014-06-10 21:53:46 +08:00
Dmitry Stogov
9a9bb8877e Improved ZTS support 2014-06-09 21:29:20 +04:00
Nikita Popov
411a8757ad Initialize GC_TYPE_INFO for EG(symbol_table) 2014-05-29 00:15:50 +02:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +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
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
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
Dmitry Stogov
0c6a6f0fba Re-applyed Bob's patch with minor fixes 2014-05-07 15:03:56 +04:00
Dmitry Stogov
4ecc527976 Reverted Bob's patch (it breaks many tests when run with opcache and needs to be fixed first). 2014-05-07 03:26:13 +04:00
Bob Weinand
f3c1881f1d Re-added fix for bug #66015 and adapted for phpng branch 2014-05-06 14:59:03 +02:00
Dmitry Stogov
1fa4dcac87 Added comment with problem description and two soltions 2014-05-06 04:35:29 +04:00
Nikita Popov
5a03efe279 Don't allocate zend_stack elements individually
Instead allocate a vector of elements. Size must now be specified
on initialization rather than on push.
2014-05-01 09:08:29 +02:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Dmitry Stogov
6a911e833f Optimized JMPZNZ to avoid multiplication at runtime (may be it makes sense to use relative addresses everywere it'll lead to Position Independent Code) 2014-04-30 11:23:19 +04: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
4e7cbf3f58 Use appropriate macros 2014-04-25 11:54:10 +04:00
Dmitry Stogov
df7ca608ce Optimized constant lookup 2014-04-25 00:56:15 +04:00
Dmitry Stogov
65e2ed6e50 Redesigned zend_execute_data layout now EX(object), EX(scope) and EX(called_scope) arr properties of the current function execution co
ntext. They are set during zend_execute_data initialization and never changed.
2014-04-24 15:53:20 +04:00
Dmitry Stogov
1f181c0f4c Chiper __autoload() function caching 2014-04-22 01:41:40 +04:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Dmitry Stogov
f71da39210 Use ZEND_HASH_FOEACH_* instead of zend_hash_apply_* 2014-04-21 13:55:25 +04:00
Dmitry Stogov
ea2e1bb1eb Optimized zend_leave_helper() 2014-04-18 13:46:36 +04:00
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Dmitry Stogov
fb4e0a6364 Removed invalid STR_RELEASE() 2014-04-16 12:28:20 +04:00
Dmitry Stogov
e99e6958bc Cleanup 2014-04-16 01:45:40 +04:00
Dmitry Stogov
f9b26bc39a Cleanup (2-nd round) 2014-04-15 21:56:30 +04:00
Dmitry Stogov
050d7e38ad Cleanup (1-st round) 2014-04-15 15:40:40 +04:00
Bob Weinand
ccf863c8ce Merge branch 'PHP-5.6' 2014-04-11 19:35:11 +02:00
Bob Weinand
35b895fdf0 Removed useless void* parameter and replaced with zend_bool on zval_update_constant* functions 2014-04-11 19:18:58 +02:00
Bob Weinand
9663193bbc Merge branch 'PHP-5.6' 2014-04-11 10:11:58 +02:00
Bob Weinand
f614fc6898 Fix bug #66015 by reverting "Removed operations on constant arrays." 2014-04-11 10:08:44 +02:00
Dmitry Stogov
91ed685e26 Close all files and resources before before destroying object storage, because resources may point to objects. (THIS CHANGE MAY BE DANGEROUS) 2014-04-11 02:22:00 +04:00
Dmitry Stogov
7402af380b Fixed destruction of objects and iterators on unclean request shutdown and GC (few cases are still unfixed).
Now we destroy objects it two steps. At first - object properties of all objects and only then the objects their selves.
2014-04-09 01:50:15 +04:00
Dmitry Stogov
3d17219cd8 Refactored zend_hash_* iteration API zend_hash_fove_forward_ex(ht, pos) and family require second argument to be real pointer.
&(ht)->nInternalPointer should be passed instead of NULL.
zend_hash_update_current_key() may work only with internal pointer.
2014-04-07 23:14:17 +04: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
6b2ed577fd Avoid unnecessry reallocations 2014-04-01 22:36:17 +04:00
Dmitry Stogov
70b7950a75 Exclude interned flags from constant flags 2014-04-01 14:20:10 +04:00
Dmitry Stogov
ea85451b65 Refactored data structures to keep zend_object* instead of a whole zval in some places 2014-03-28 02:11:22 +04:00
Dmitry Stogov
9a8fbdf2f4 Use CV variable offset instead of CV variable number 2014-03-27 16:00:25 +04:00
Dmitry Stogov
c6cba55454 Use ZVAL_DEREF() macro 2014-03-27 13:39:09 +04:00
Dmitry Stogov
f53c31265f Fixed symbol table detaching 2014-03-27 00:04:50 +04:00
Dmitry Stogov
887189ca31 Refactored IS_INDIRECT usage for CV and object properties to support HashTable resizing 2014-03-26 18:07:31 +04:00
Dmitry Stogov
ef6919e6f2 Fixed static data cleanup 2014-03-21 13:51:18 +04:00
Dmitry Stogov
6123deb30f Fixed refcounting (proper fix) 2014-03-21 01:08:26 +04:00
Dmitry Stogov
cce7d5a1ec Fixed refcounting 2014-03-21 00:34:26 +04:00
Dmitry Stogov
36cd92a7d3 Fixed passing argument by refefence from internal functions 2014-03-20 17:03:32 +04:00
Dmitry Stogov
da9a2872b0 Fixed cleanup on request shutdown 2014-03-18 14:52:54 +04:00
Dmitry Stogov
aa5f55306b Refactored EG(active_symbol_table) to be zend_array* instead of HashTable* 2014-03-17 23:15:22 +04:00
Dmitry Stogov
d708d3c596 Fixed passing arguments by reference from internal functions 2014-03-11 22:33:28 +04:00
Xinchen Hui
53e312c663 Review ended
Revert "An demo(for review) to show how to fix the problem(symbol table resize)"

This reverts commit 60c354510b.
2014-03-11 14:23:14 +08:00
Xinchen Hui
60c354510b An demo(for review) to show how to fix the problem(symbol table resize) 2014-03-10 16:25:05 +08:00
Xinchen Hui
80625f20e5 Revert "An demo(for review) to show how to fix the problem we meet"
This reverts commit 4aeae15706.
2014-03-10 16:24:35 +08:00
Xinchen Hui
4aeae15706 An demo(for review) to show how to fix the problem we meet 2014-03-10 11:29:28 +08:00
Xinchen Hui
4b40e40ad0 Fixed memleak while sending IS_REFERENCE 2014-03-09 11:48:09 +08:00
Dmitry Stogov
6b303a6bd6 Fixed refcounting 2014-03-07 01:33:33 +04:00
Dmitry Stogov
8d2fb9d479 Internal functions may return (e.g. on wrong arguments) keeping the original return_value. So we have to initialize return_value as IS_NULL. 2014-03-06 13:32:43 +04:00
Dmitry Stogov
f3b4b16883 Fixed passing reference by value in call_user_func() 2014-03-06 01:04:28 +04:00
Dmitry Stogov
018be97c0d Fixed support for undefined constants in RECV_INIT 2014-03-06 00:15:56 +04:00
Dmitry Stogov
84c092f6d6 Fixed by reference parameter passing from internal functions 2014-03-05 16:17:00 +04:00
Dmitry Stogov
3733737328 Handle interned strings as non-refcounted scalars 2014-03-05 13:55:56 +04:00
Dmitry Stogov
19670c2bbc Fixied calling object closures from internal functions 2014-03-05 01:54:21 +04:00
Dmitry Stogov
3810b4ab4a Fixed constant expressions in array indeces handling 2014-02-27 16:41:41 +04:00
Dmitry Stogov
3696e038e5 Various fixes related to read_property(), read_dimension() and iterators refactoring 2014-02-27 16:07:36 +04:00
Dmitry Stogov
78fc6b3570 Fixed refcounting 2014-02-26 01:09:34 +04:00
Dmitry Stogov
77abd35b78 Fixed memory leak 2014-02-25 16:20:42 +04:00
Dmitry Stogov
639e4e1afa Changes zend_is_callable() to use zend_string* instead of char* 2014-02-25 16:03:34 +04:00
Xinchen Hui
499b553c18 Fixed NULL pointer dereference 2014-02-25 18:14:22 +08:00
Dmitry Stogov
789eb6dfc3 Fixed create_function() 2014-02-24 16:35:55 +04:00
Dmitry Stogov
595fc4d901 More constant related fixes 2014-02-24 15:49:15 +04:00
Dmitry Stogov
abb57cc1c2 Merge branch 'refactoring2' of github.com:zend-dev/php into refactoring2 2014-02-24 15:25:43 +04:00
Dmitry Stogov
f4c2810ab4 fixed support for constant expressions 2014-02-24 15:25:24 +04:00
Xinchen Hui
479b82c0d4 Fixed invalid write in vsprintf tests 2014-02-24 17:26:09 +08:00
Dmitry Stogov
23c9d3eb01 Fixed zend_rebuild_symbol_table() using IS_INDIRECT 2014-02-24 11:31:46 +04:00
Dmitry Stogov
008a42e7c8 Fixed error messages 2014-02-21 20:53:09 +04:00
Dmitry Stogov
52bd62eca8 Fixed assertions 2014-02-21 20:35:40 +04:00
Xinchen Hui
76c28f878a Fixed missed REFCOUNTED checking 2014-02-21 22:39:27 +08:00
Dmitry Stogov
8bae1daa0c Use better data structures (incomplete) 2014-02-19 14:35:28 +04:00
Dmitry Stogov
9067dbcd0d Use better data structures (incomplete) 2014-02-19 12:03:01 +04:00
Dmitry Stogov
557994d50d Use better data structures (incomplete) 2014-02-19 01:12:05 +04:00
Dmitry Stogov
9e6c0c6a89 Use better data structures (incomplete) 2014-02-18 17:31:27 +04:00
Dmitry Stogov
5de7115679 Use better data structures (incomplete; able to run bench.php) 2014-02-18 16:27:38 +04:00
Dmitry Stogov
a0fe8e5a91 Use better data structures (incomplete) 2014-02-18 01:41:23 +04:00
Dmitry Stogov
2b9b9afa7a Use better data structures (incomplete) 2014-02-17 17:59:18 +04:00
Dmitry Stogov
17bf59f895 Use better data structures (incomplete) 2014-02-14 17:48:45 +04:00
Dmitry Stogov
686a078258 Use better data structures (incomplete) 2014-02-14 14:55:48 +04:00
Dmitry Stogov
be82a07776 Use better data structures (incomplete) 2014-02-12 18:08:11 +04:00
Dmitry Stogov
4e66abad54 Use better data structures (incomplete) - refactored return_value handling 2014-02-12 14:29:51 +04:00