Commit Graph

1308 Commits

Author SHA1 Message Date
Aaron Piotrowski
8146c47d85 Fix error message 2016-06-03 18:29:24 -05:00
Aaron Piotrowski
72692e9a9c Add iterable pseudo-type 2016-06-03 17:42:04 -05:00
Dmitry Stogov
b111da96d9 Split ZEND_SEND_VAR_NO_REF into ZEND_SEND_VAR_NO_REF and ZEND_SEND_VAR_NO_REF_EX (similar to ZEND_SEND_VAL) and remove ZEND_ARG_* flags. 2016-05-31 04:06:00 +03:00
Nikita Popov
91f5940329 Forbid dynamic calls to scope introspection functions
Per RFC:
https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
2016-05-24 20:48:24 +02: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
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
8a7a913a7a Use main VM stack for generators. Only single call frame for generator itself is allocated on heap, call frames for nested functions are allocated on main VM stack. In case "yield" used in context of another function call, call stack has to be frozen and then restored. 2016-05-12 00:44:18 +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
b91197c8a3 Inlined fast path 2016-05-04 17:33:35 +03:00
Joe Watkins
c38310f25a change fcall and statement handlers to accept frame 2016-05-04 09:28:13 +01:00
Bob Weinand
f59de7ea36 Export zend_pass_function to allow comparisons against it 2016-04-30 20:46:52 +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
c026ca6cdc Merge branch 'master' into safe_timeout
* master:
  Fixed bug #72059 - Reference the bug id directly in NEWS
  Fix magic constants (__LINE__) with ?? for constant scalar exprs
  Add NEWS entry for ?? in constant scalar expressions
  allow null coalescing (??) on constant expressions
  Fix intl tests for ICU < 52
  Fix ZTS builds by adding a missing TSRMLS_FETCH().
  Fix bug #71737
  Update NEWS
  Fix RECV opcode to handle all kinds of exceptions
  Fix RECV opcode to handle all kinds of exceptions
2016-04-21 10:15:57 +03:00
Bob Weinand
36202ef056 Merge remote-tracking branch 'origin/PHP-7.0' 2016-04-21 01:26:48 +02:00
Márcio Almada
9f3eab44df allow null coalescing (??) on constant expressions 2016-04-21 01:22:28 +02:00
Dmitry Stogov
650c1c0a7d Safe execution timeout handling. 2016-04-20 13:52:21 +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
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
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
Dmitry Stogov
eaf489ac2b Optimize ASSIGN_DIM (separate common unspecializeble code into helper functions). 2016-04-12 19:36:24 +03:00
Dmitry Stogov
ef0099918f Separate unspecializeble code of INIT_DYNAMIC_CALL into separate helper functions. 2016-04-12 14:41:06 +03:00
Dmitry Stogov
a186ac0e47 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-04-05 20:09:14 +03:00
Dmitry Stogov
d0c6c179cd Initialize op_array->run_time_cache on slow path of INIT_FCALL opcode and omit corresponding check on fast path of DO_FCALL. 2016-04-05 00:01:00 +03:00
Dmitry Stogov
7abfaac901 Merge zend_execute_data->called_scope into zend_execute_data->This.
"called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this.
Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL).
Some code might need to be adopted to support this change.
Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
2016-04-01 16:17:49 +03:00
Dmitry Stogov
86a1aeed22 Flags ZEND_CALL_RELEASE_THIS and ZEND_CALL_CLOSURE should never be set together.
Closures keep responsibility for releasing $this theirselves.
2016-03-31 18:58:13 +03:00
Nikita Popov
80a722a634 Drop some dead defines 2016-03-20 01:35:51 +01:00
Dmitry Stogov
fc7cbdce61 Squashed commit of the following:
commit 98471821a8
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 21:56:04 2016 +0300

    Fixed wrong constant usage

commit 8183b811e7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 21:10:23 2016 +0300

    Added ability to serialize and serialize opcode handlers for file-cache

commit 3516b261de
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 10:11:59 2016 +0300

    Added missed file

commit f4475a2360
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Mar 17 10:00:45 2016 +0300

    Transparently introduce type-specialized opcode handlers.
    This affects only PHP VM, and doesn't change anything else.
2016-03-17 22:00:27 +03:00
Xinchen Hui
73e8c08788 Sorry for that... Merged by accident....
Revert "Transparently introduce type-specialized opcode handlers."

This reverts commit 59d00b8bcc.
2016-03-17 11:59:15 +08:00
Dmitry Stogov
59d00b8bcc Transparently introduce type-specialized opcode handlers.
This affects only PHP VM, and doesn't change anything else.
2016-03-16 03:36:58 +03:00
Dmitry Stogov
827a7a180b Added possibility for extra specialization for SMART_BRANCH (e.g. IS_EQUAL+JMPZ superinstruction). 2016-03-11 12:17:03 +03:00
Dmitry Stogov
ff8337b783 Merge branch 'PHP-7.0'
* PHP-7.0:
  More effecient fix for bug #71756
2016-03-10 13:34:00 +03:00
Dmitry Stogov
f8506c062f More effecient fix for bug #71756 2016-03-10 13:33:36 +03:00
Xinchen Hui
a468901e97 Merge branch 'PHP-7.0'
* PHP-7.0:
  Improve the codes (FETCH_DIM_R/IS is read context, we should not expose IS_REFERENCE)
2016-03-10 15:10:26 +08:00
Xinchen Hui
675c295722 Improve the codes (FETCH_DIM_R/IS is read context, we should not expose IS_REFERENCE) 2016-03-10 15:09:51 +08:00
Xinchen Hui
4c388004d4 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71754 (Regression in PHP7.0: trivial script segfaults php-cgi)
  Bug #71756 (Call-by-reference widens scope to uninvolved functions when used in switch)
  tsrm_win32_get_path_sid_key might returns NULL (Partially fix bug #71752)
2016-03-10 15:03:25 +08:00
Xinchen Hui
9833c76d3f Bug #71756 (Call-by-reference widens scope to uninvolved functions when used in switch) 2016-03-10 14:58:10 +08:00
Francois Laupretre
370b7039e4 Add support for negative string offsets (syntax) 2016-03-09 14:41:37 +01:00
Dmitry Stogov
2e94cba430 Use quick check for first arguments 2016-02-26 21:44:28 +03:00
Francois Laupretre
be607e724c Fix bug #71572
Discussed on the internals list as part of
http://markmail.org/message/fa625yc2eegk2dio.
2016-02-14 13:18:23 +01:00
Nikita Popov
44ed1cb5c0 Remove ZEND_CALL_CTOR_RESULT_UNUSED
Instead emit a FREE on the result of NEW.
2016-02-11 22:15:11 +01:00