Commit graph

2360 commits

Author SHA1 Message Date
Dmitry Stogov
990d8092a4 Reverted incomplete fix and too strict asserts. 2017-11-01 16:18:13 +03:00
Dmitry Stogov
02a05146fd Fixed string interning during constants substitution 2017-11-01 10:56:37 +03:00
Xinchen Hui
a8a17a72b0 RC manipulation cleanup 2017-11-01 10:25:10 +08:00
Dmitry Stogov
d481d495cc Fixed few inconsistent ZVALs in AST produced by compiler (REFCOUNTED and INTERNED strings) 2017-11-01 01:10:21 +03:00
Dmitry Stogov
5dbdc382af Intern file names and class constants in first place (they may be interned later during constant substitution) 2017-10-31 15:36:55 +03:00
Dmitry Stogov
fcc08ce19f Prevent reference-counting on persistent zvals (internal constants, default properties and constants of internal classes).
New macro ZVAL_COPY_OR_DUP() is used perform duplication, if necessary.
This should eliminate related race-coditions in ZTS build and prevent reference-counting bugs after unclean shutdown.
2017-10-30 23:13:10 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Dmitry Stogov
edc7c8ccfa PHP must not create circular arrays when element is assigned by value. 2017-10-12 16:23:45 +03:00
Dmitry Stogov
ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Dmitry Stogov
39ded1d5f8 Changed zend_ast_ref structure to use only one allocation, removing dichotomy between heap/arena ASTs. 2017-10-09 16:57:51 +03:00
Dmitry Stogov
e70618aff6 Changed the way VM accesses constant operands in 64-bit builds. 2017-10-04 16:53:01 +03:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Dmitry Stogov
a80e462fbd Order live ranges according to "start" position 2017-08-14 12:21:07 +03:00
Dmitry Stogov
2fab62271a Revert "Fixed live_range removing (bug can be triggred by JIT)"
This reverts commit aecf996510.
2017-08-14 12:00:02 +03:00
Xinchen Hui
aecf996510 Fixed live_range removing (bug can be triggred by JIT) 2017-08-11 21:56:30 +08:00
Dmitry Stogov
1180d8c801 Separate ISSET_ISEMPTY_CV/UNSET_CV from ISSET_ISEMPTY_VAR/UNSET_VAR 2017-07-17 14:11:50 +03:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Nikita Popov
e5741da85c Fix format arguments
Only dropped one before, both need to go...
2017-06-25 22:32:57 +02:00
Nikita Popov
9dfcb04f10 Fix typo 2017-06-25 22:28:56 +02:00
Michał Brzuchalski
8e10c9d373 Implement object type annotation
RFC: https://wiki.php.net/rfc/object-typehint
2017-06-25 21:49:41 +02:00
Dmitry Stogov
a916bed8f8 Fixed function name resolution 2017-05-30 21:48:16 +03:00
Dmitry Stogov
65edf44291 Check for possible run-time function name resolution 2017-05-30 17:37:54 +03:00
Dmitry Stogov
6043f76ad7 Added ZEND_FUNC_NUM_ARGS, ZEND_FUNC_GET_ARGS instructions, to implement corresponding builtin functions.
Special optimisation for "array_slice(INT, func_get_args())" pattern.
2017-05-30 13:23:17 +03:00
Dmitry Stogov
017d65d74a Extend ZEND_SEND_ARRAY to eliminate array_slice() call for "call_user_func_array(_, array_slice(_, LONG, _))" pattern. 2017-05-30 12:25:46 +03:00
Dmitry Stogov
d32288b5bf Fixed copy-paste mistake 2017-05-25 20:20:57 +03:00
Dmitry Stogov
f00d1c72b4 Added ZEND_GET_CLASS, ZEMD_GET_CALLED_CLASS, ZEND_GET_TYPE instructions, to implement corresponding builtin functions. 2017-05-25 18:41:28 +03:00
Dmitry Stogov
cd953269d3 Added ZEND_COUNT instruction, to implement corresponding builtin. 2017-05-25 12:52:34 +03:00
Dmitry Stogov
44ec732752 Fixed ZEND_IN_ARRAY related issues 2017-05-25 10:26:42 +03:00
Dmitry Stogov
7c7383067f Added ZEND_IN_ARRAY instruction, implementing optimized in_array() builtin function, through hash lookup in flipped array 2017-05-24 23:00:48 +03:00
Dmitry Stogov
8203a175b1 Remove unused opcode handlers 2017-05-18 13:18:08 +03:00
Anatol Belski
d5bc862470 avoid strlen in common case 2017-05-16 12:52:16 +02:00
Anatol Belski
de9124a2e7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74589 __DIR__ wrong for unicode character
  fixing run-tests.php for variables_order="GPCS"
2017-05-15 16:36:40 +02:00
Anatol Belski
ae3f975c5d Fixed bug #74589 __DIR__ wrong for unicode character 2017-05-15 16:35:22 +02:00
Xinchen Hui
8daef7e423 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed another potential dangling pointer
2017-05-08 11:36:35 +08:00
Xinchen Hui
2d30bc96a1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed another potential dangling pointer
2017-05-08 11:36:29 +08:00
Xinchen Hui
b966a8b5fa Fixed another potential dangling pointer 2017-05-08 11:36:07 +08:00
Xinchen Hui
1466925cb0 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:33:01 +08:00
Xinchen Hui
2c070847e7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:32:27 +08:00
Xinchen Hui
87d56a3d07 Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER()) 2017-05-08 11:32:08 +08:00
Andrea Faulds
44156b3114 Drop ZEND_API from zend_assert_valid_class_name
This is a convenience function for internal use and shouldn't have been
exported.
2017-04-29 16:09:08 +01:00
Nikita Popov
b6a4aad820 Remove the ZEND_ACC_CLONE flag
This one is completely unused
2017-04-22 15:47:53 +02:00
Nikita Popov
28218b4acc Merge branch 'PHP-7.1' 2017-04-15 18:15:45 +02:00
Nikita Popov
2719b8e91c Merge branch 'PHP-7.0' into PHP-7.1 2017-04-15 18:15:33 +02:00
Nikita Popov
e433c23b96 Improve accuracy of opline lineno information
If compile_var() was used instead of compile_expr() we did not
update the current lineno.
2017-04-15 18:15:24 +02:00
Nikita Popov
7f5d47dfd1 Merge branch 'PHP-7.1' 2017-04-15 01:40:59 +02:00
David Matejka
2135b057ec Fixed bug #74444: multiple catch freezes in some cases
zend_emit_jump() may reallocate, so reload the opline.
2017-04-15 01:38:37 +02:00
Sammy Kaye Powers
e92896f735 Remove spurious CG(context).in_finally dingleberry 2017-04-10 22:58:44 +02:00
Nikita Popov
ad8652818a Implement jumptable optimization 2017-04-10 22:23:14 +02:00
Nikita Popov
16861838a5 Merge branch 'PHP-7.1' 2017-03-23 22:50:21 +01:00