Commit graph

1830 commits

Author SHA1 Message Date
Dmitry Stogov
88196e9151 Added specialized handler for ZEND_FETCH_DIM_R opcode with only numeric indexes. 2016-05-18 15:06:49 +03:00
Xinchen Hui
37b1226af1 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  Inlined fast paths of the freqently execute handlers for FETCH_DIM_R.
2016-05-17 20:28:26 +08:00
Xinchen Hui
fad91468db Revert "Fixed Bug #72213 (Finally leaks on nested exceptions)"
This reverts commit 5037ebf058.
2016-05-17 20:27:16 +08:00
Dmitry Stogov
c466df6813 Inlined fast paths of the freqently execute handlers for FETCH_DIM_R. 2016-05-17 15:08:04 +03:00
Dmitry Stogov
34a6c93b25 Specialize ZEND_ASSIGN_ADD and family according to value of opline->extended_value 2016-05-17 11:46:25 +03:00
Xinchen Hui
5037ebf058 Fixed Bug #72213 (Finally leaks on nested exceptions) 2016-05-17 15:32:43 +08:00
Dmitry Stogov
8f7b1a3248 IS_CONST operands don't have to be separated. Use reference-counting instead of duplication.
- with opcache all IS_CONST operands are not refcounted (scalars, interned strings or immutable arrays)
- without opcache IS_CONST operands are not shared between processes or threads and may use common reference counters
2016-05-17 08:45:06 +03:00
Dmitry Stogov
1fe7b3bca1 micro-optimisation 2016-05-17 02:09:29 +03:00
Dmitry Stogov
97bf4e0b12 Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function 2016-05-16 12:42:13 +03:00
Dmitry Stogov
414c4c6776 Revert "Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function."
This reverts commit a9b517c614.
2016-05-16 11:51:29 +03:00
Dmitry Stogov
a9b517c614 Check if generator object is created by GENERATOR_CREATE when throw exceptions from generator function. 2016-05-16 10:24:13 +03:00
Dmitry Stogov
be071702b3 Fixed bug #72188 (Nested try/finally blocks losing return value) 2016-05-13 14:38:43 +03:00
Dmitry Stogov
ccf18da450 Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast path of DO_FCALL* handlers.
This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization.
Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
2016-05-13 01:40:15 +03:00
Dmitry Stogov
7b94b958cc Intern some known (and offten used) strings. 2016-05-12 13:47:22 +03:00
Dmitry Stogov
cca2c8ecc4 Reimplemented Bob's commit bac6fdb0c5 without insignificant renaming and white-space changes 2016-05-06 10:47:58 +03:00
Dmitry Stogov
c19cb70dac Revert "Refactor zval cleanup into single function"
This reverts commit bac6fdb0c5.
2016-05-06 10:47:58 +03:00
Bob Weinand
bac6fdb0c5 Refactor zval cleanup into single function
Also use zval_ptr_dtor_nogc() everywhere in Zend in favor of zval_dtor()
2016-05-05 23:31:57 +02:00
Dmitry Stogov
26adba38bc Micro-optimization 2016-05-05 16:19:59 +03:00
Joe Watkins
c38310f25a change fcall and statement handlers to accept frame 2016-05-04 09:28:13 +01:00
Nikita Popov
d06431bf1b Merge branch 'PHP-7.0' 2016-05-03 18:15:29 +02:00
Nikita Popov
fbae590bf0 Fix leaks in QM_ASSIGN, JMP_SET and COALESCE
The QM_ASSIGN code was rewritten to use the standard pattern for
handling CVs and VARs.
2016-05-03 18:12:56 +02:00
Bob Weinand
7c174b6197 Fix use after free on AST expressions in constant declarations 2016-05-02 18:22:15 +02:00
Dmitry Stogov
3e9419dd28 Fixed compilation warnings 2016-04-29 14:03:33 +03:00
Dmitry Stogov
747a482b9c Don't initialize EX(call)->symbol_table on each function call.
Keep it uninitialized, and check ZEND_CALL_HAS_SYMBOL_TABLE flag when necessary.
2016-04-28 15:17:24 +03:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Dmitry Stogov
11e06e91ec Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72101 (crash on complex code)
2016-04-25 14:15:06 +03:00
Dmitry Stogov
92233dd736 Fixed bug #72101 (crash on complex code) 2016-04-25 14:11:46 +03:00
Nikita Nefedov
19759a5602 Fix RECV opcode to handle all kinds of exceptions
fix RECV opcode to handle exceptions thrown from user-defined error handler
as a result Notice error from failed type coercion
2016-04-20 08:40:44 -07:00
Xinchen Hui
f768a2ea3b Merge branch 'fix-recv-opcode-handle-exception' of https://github.com/nikita2206/php-src 2016-04-20 08:40:11 -07:00
Nikita Nefedov
ed9a1a9d68 Fix RECV opcode to handle all kinds of exceptions
fix RECV opcode to handle exceptions thrown from user-defined error handler
as a result Notice error from failed type coercion
2016-04-20 11:56:07 +03:00
Dmitry Stogov
f484801483 Reduced amount of code generated for interrupt handling.
Improved ZEND_VM_INTERRUPT_CHECK() placement (always perform checks after opcode handler completion, when instruction pointer value is alredy changed to the next opcode).
2016-04-20 11:06:52 +03:00
Nikita Popov
d79288c6bb Merge branch 'PHP-7.0' 2016-04-18 22:46:36 +02:00
Nikita Popov
73958ca62d Fix SEND_USER as well
Missed copy&paste code here
2016-04-18 22:45:38 +02:00
Nikita Popov
5a538e1d82 Merge branch 'PHP-7.0' 2016-04-18 18:26:30 +02:00
Nikita Popov
a8792158bd Fix SEND_ARRAY+PREFER_REF SHM corruption
Make the behavior consistent between namespaced and not and with
PHP 5.6.
2016-04-18 18:26:20 +02:00
Xinchen Hui
b5d01ab5a1 Merge branch 'PHP-7.0'
* PHP-7.0:
  combine conditions
2016-04-18 19:14:30 +08:00
Xinchen Hui
aa9f8e695c combine conditions 2016-04-18 19:13:54 +08:00
Nikita Popov
12f42346a8 Merge branch 'PHP-7.0' 2016-04-16 22:34:32 +02:00
Nikita Popov
d1a38743a5 Fix SEND_UNPACK array separation
Separating only immutable arrays is not enough.
2016-04-16 22:33:23 +02:00
Bob Weinand
3ed4a592aa Merge branch 'PHP-7.0' 2016-04-16 20:38:10 +02:00
Bob Weinand
15d1d4f45b Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice) 2016-04-16 20:36:19 +02:00
Nikita Popov
dd6c6b1c48 Cleanup condition in SEND_VAR_NO_REF
Was overly convoluted after the IS_VAR_RET_REF removal.
2016-04-16 14:32:48 +02:00
Nikita Popov
64f91774f2 Remove IS_VAR_RET_REF flag
Instead decide whether a function returned by reference or by value
by checking whether the return value has REFERENCE type. This means
that functions returning by reference must always return a reference
and functions returning by value must not return a reference.
2016-04-15 15:32:20 +02:00
Dmitry Stogov
562d6315b1 Optimize zend_binary_assign_op_dim_helper() 2016-04-14 02:35:53 +03:00
Dmitry Stogov
e95efb6312 Move rare cases of DO_FCALL into separate helpers. 2016-04-13 20:13:17 +03:00
Dmitry Stogov
85f35a8fc1 Separate unspecializeble code of INCLIDE_OR_EVAL into helper functions 2016-04-13 15:29:01 +03:00
Dmitry Stogov
f48b20721c ASSIGN_ADD micro optimization 2016-04-13 02:47:17 +03:00
Dmitry Stogov
a809444b64 Delay IS_UNDEF check for FETCH_DIM_W and family 2016-04-13 01:19:20 +03:00
Dmitry Stogov
0b3e2fe2b1 Delay IS_UNDEF check for FETCH_DIM_R and family 2016-04-13 00:05:19 +03:00
Dmitry Stogov
23b65bf732 Reuse zend_fetch_dimension_address_read() for FETCH_LIST 2016-04-12 22:53:01 +03:00