Commit Graph

1436 Commits

Author SHA1 Message Date
Dmitry Stogov
d393199e13 Fixed compilation warnings 2018-02-22 11:33:26 +03:00
Dmitry Stogov
bd908f6145 Fixed build without global register variables 2018-02-22 11:00:29 +03:00
Dmitry Stogov
927748b271 Reorganize make_real_object() related code 2018-02-21 18:43:38 +03:00
Dmitry Stogov
ecb52b8b3b Move exceprional code into helper & zend_fetch_var_address_helper() micro-optimization. 2018-02-21 17:09:42 +03:00
Dmitry Stogov
7559b1c50c Move result address calculation from specialized handlers to less specialized helpers 2018-02-21 16:06:29 +03:00
Dmitry Stogov
9c0427cada Mark exceptional helpers as "cold" 2018-02-21 12:07:29 +03:00
Dmitry Stogov
e1b1cff48d Move exceptional code into helpers 2018-02-21 10:10:04 +03:00
Dmitry Stogov
a00286921e Move cold code, duplicated by specializer, into helper functions 2018-02-20 23:44:25 +03:00
Dmitry Stogov
b46f10b43f Fixed build without global register variables 2018-02-20 20:39:02 +03:00
Dmitry Stogov
8b7cdbaa49 Separate slow path with make_real_object() and related code into "cold" function. 2018-02-20 17:22:11 +03:00
Dmitry Stogov
cbf2d91911 Separate cold paths of ISSET_ISEMPTY_DIM_OBJ 2018-02-20 14:42:53 +03:00
Dmitry Stogov
a3afad5af0 Added tracer to collect frequency of opcode handler call chains 2018-02-19 16:50:24 +03:00
Nikita Popov
b0af9ac733 Avoid live range references in opcodes
Don't store the live range of the freed variable for FREE_ON_RETURN
frees, instead look it up at runtime. As this is an extremely
unlikely codepath (in particular, it requires a loop variable with
a throwing destructor), saving the runtime lookup of the live range
is not worth the extra complexity this adds everywhere else.
2018-02-16 21:30:48 +01:00
Dmitry Stogov
6fadb72c0b Move exceptional code into "cold" helpers 2018-02-16 02:45:31 +03:00
Dmitry Stogov
02aea893fb Use Z_TYPE_INFO_REFCOUNTED() macro 2018-02-15 21:54:49 +03:00
Dmitry Stogov
ca035f26aa Moved "zval.u2.cache_slot" into free room of "zend_op" 2018-02-05 19:41:47 +03:00
Dmitry Stogov
3a794d39f0 Avoid repeatable ARG_SHOULD_BE_SENT_BY_REF() checks in FETCH_*FUNC_ARG and following SEND_VAR_EX. Perform the check once in a new CHECK_FUNC_ARG opcode and reuse in the following FETCH_*FUNC_ARG and SEND_FUNC_ARG (SEND_VAR_EX replacement). 2018-02-05 19:40:06 +03:00
Dmitry Stogov
9a6100f9dd Break dependency between IS_TYPE_REFCOUNTED and ZEND_CALL_FREE_EXTRA_ARGS 2018-02-02 17:38:07 +03:00
Dmitry Stogov
1d7eab12e6 Avoid redundand mask extraction 2018-01-31 13:34:34 +03:00
Dmitry Stogov
7141631cc8 Change FETCH/ISSET instruction modifiers:
- Get rid of ZEND_ISEMPTY and ZEND_ISSET_ISEMPTY_MASK. Use just single ZEND_ISSET bit to make distinct between isset() and empty()
- Use ZEND_FETCH_GLOBAL, ZEND_FETCH_LOCAL and ZEND_FETCH_GLOBAL_LOCK as bitmask
- Removed unused ZEND_FETCH_STANDARD
- Extended ZEND_FETCH_ARG_MASK
2018-01-30 22:06:05 +03:00
Dmitry Stogov
1613b6a06b Expand SEPARATE_STRING() 2018-01-18 02:30:07 +03:00
Dmitry Stogov
25a44cb99e Eliminate duplication, increment_string() performs it anyway. 2018-01-17 20:09:28 +03:00
Dmitry Stogov
12c386f5b9 Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. (reapply 781e1573af, now it should be OK). 2018-01-11 22:15:45 +03:00
Dmitry Stogov
6ba10a03e7 Revert "Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse." (this patch is incomplete or wrong)
This reverts commit 781e1573af.
2018-01-11 17:27:26 +03:00
Dmitry Stogov
781e1573af Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. 2018-01-11 16:25:28 +03:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
6e4d18924b Combine READY_TO_DESTROY, EXTRACT_ZVAL_PTR and FREE_OP_VAR_PTR into single, better optimized, macro. 2017-12-26 16:50:34 +03:00
Dmitry Stogov
35b3fdfd0a Separate exceptional code into cold functions. 2017-12-22 16:35:52 +03:00
Dmitry Stogov
3aceab825a Manual loop optimizaton.
Cost of the loops body is still the same, but the loop headers are improved.
2017-12-14 03:39:22 +03:00
Dmitry Stogov
4d19bc2279 Disable some "bad" GCC optimizations 2017-12-14 03:25:20 +03:00
David Walker
6d4de4cf05 Implement list() reference assignments
Support list() reference assignments of the form:

    list(&$a, list(&$b, $c)) = $d;

RFC: https://wiki.php.net/rfc/list_reference_assignment
2017-12-09 13:39:52 +01:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Dmitry Stogov
d1d1aff4e5 Optimization of init_func_execute_data() 2017-12-06 02:53:30 +03:00
Nikita Popov
828d8e635b Fix ZEND_VM_SPEC=0 build 2017-11-24 23:06:01 +01:00
Nikita Popov
6b258197e8 Fix zend_fetch_dimension_const()
Pass IS_TMP_VAR instead of IS_CONST as operand type, as IS_CONST
requires additional guarantees that are not necessarily
satisfied by the caller.
2017-11-24 21:24:13 +01:00
Dmitry Stogov
ec2dde0c0b Introduced zend_hash_find_ex() that may avoid unnecessary hash value check. 2017-11-24 14:01:19 +03:00
Dmitry Stogov
6780c74619 Allowed modification of VM stack page size. Exported few functions. Green light for Fibers/Coroutines. 2017-11-22 15:36:09 +03:00
Nikita Popov
26f8fc833b Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Dmitry Stogov
ccc12b82da Avoid unnecessary reference-counting on strings. 2017-11-16 17:09:32 +03:00
Dmitry Stogov
ce18738a30 Removed "_" from API functions. 2017-11-16 17:09:01 +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
aeca761856 Removed useless reallocations 2017-10-26 19:13:53 +03:00
Dmitry Stogov
6a034be2c6 Fixed signed/unsigned comparisons 2017-10-25 11:45:17 +03:00
Dmitry Stogov
59a7944bc6 Made run_time_cache to keep "offset" to dynamic properties Buckets (instead of index). 2017-10-24 10:28:19 +03:00
Dmitry Stogov
ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Dmitry Stogov
fcccb0d6ea Use zval_ptr_dtor_nogc() in places where circular zvals are not possible 2017-10-09 12:24:11 +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
0fb05f1487 Property access micro-optimization. (ZEND_WRONG_PROPERTY_OFFSET and ZEND_DYNAMIC_PROPERTY_OFFSET are hidden, use one comparison instead of two on fast paths. "Negative" offsets are reserved for future optimizations). 2017-09-18 13:13:24 +03:00