Commit Graph

1292 Commits

Author SHA1 Message Date
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
Nikita Popov
5faedf5b3e Remove EXT_TYPE_UNUSED in favor of IS_UNUSED
This means we no longer allocate an unused VAR for the retval of
instructions that support unused results.

Nearly all instructions already used the result variable only if
it was used. The only exception to this was the return value
variable for internal function call results. I've adjusted the code
to use a stack zval for the unused return case now. As we have
retval specialization now, we know that it doesn't matter.
2016-02-11 18:02:19 +01:00
Bob Weinand
00a2c30c59 Add extra VM operand specialization
For now RETVAL and OP_DATA= are supported
2016-02-04 16:49:50 +01:00
Dmitry Stogov
d510255879 Rename IS_ERROR into _IS_ERROR (to prevent redefinition on Windows). 2016-02-01 11:12:28 +03:00
Dmitry Stogov
86f54fcdf7 Use special type IS_ERROR instread of EG(error_zval). (we still need EG(error_zval) for SPL support). 2016-01-28 18:00:06 +03:00
Dmitry Stogov
e99fe9865e Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71474 (Crash because of VM stack corruption on Magento2).
2016-01-28 11:54:48 +03:00
Dmitry Stogov
6039d2d914 Fixed bug #71474 (Crash because of VM stack corruption on Magento2). 2016-01-28 11:41:15 +03:00
Dmitry Stogov
6579e48417 Introduced BIND_STATIC opcode instead of FETCH_R/FETCH_W(static)+ASSIGN/ASSIGN_REF (similar to BIND_GLOBAL).
In the future we may refer to static variable by index instead of name, to eliminate hash lookup.
2016-01-12 12:20:35 +03:00
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
4abbfb9707 Marked function as "cold" 2015-12-24 16:03:31 +03:00
Xinchen Hui
70f9ba00f7 This check become useless after 98885bfa1e 2015-12-23 20:56:49 +08:00
Dmitry Stogov
98885bfa1e Consolidate indirect string offset modification checks (Nikita, Dmitry)
Check it once, instead of dozens of times.
2015-12-23 13:52:15 +03:00
Dmitry Stogov
4c9e4caab4 Fixed typo 2015-12-10 21:17:24 +03:00
Xinchen Hui
02d7001962 Merge branch 'PHP-7.0' 2015-12-09 21:09:09 +08:00
Xinchen Hui
4c379392b2 Fixed bug #71067 (Local object in class method stays in memory for each call) 2015-12-09 21:07:59 +08:00
Andrea Faulds
366ba41334 Add void return type 2015-11-18 17:30:49 +00:00