Commit Graph

1309 Commits

Author SHA1 Message Date
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
Dmitry Stogov
43b1618023 Added missing "goto" 2016-04-12 22:15:16 +03:00
Dmitry Stogov
eaf489ac2b Optimize ASSIGN_DIM (separate common unspecializeble code into helper functions). 2016-04-12 19:36:24 +03:00
Nikita Popov
fea822fe1b Merge branch 'PHP-7.0' 2016-04-12 14:44:43 +02:00
Nikita Popov
4e585eb429 Fix ZEND_SEPARATE for by-val func returning ref zval 2016-04-12 14:44:29 +02:00
Nikita Popov
6a2eee520a Drop unnecessary ZEND_SEPARATE code
The following write ops will separate if necessary.
2016-04-12 14:44:29 +02: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
8453b78113 Improve zend_leave_helper() by checking all rare conditions at once. 2016-04-11 13:17:24 +03:00
Dmitry Stogov
513b9929a1 removed useless ckeck (ZEND_HANDLE_EXCEPTION never uses RETURN_VALUE) 2016-04-08 16:12:32 +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
32d6ac4ddf RETURN micro optimization 2016-04-05 16:45:15 +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
Dmitry Stogov
fcbe1e8edf Use CALL_INFO flag to check if we need to destroy symbol_table.
This saves one memory load on most RETURN opcodes.
2016-03-31 18:47:25 +03:00
Xinchen Hui
0a2746fb4b Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71914 (Reference is lost in "switch")
2016-03-29 17:14:48 +08:00
Xinchen Hui
2e6d70787c Fixed bug #71914 (Reference is lost in "switch") 2016-03-29 17:14:36 +08:00
Nikita Popov
8e5b139732 Evaluate arguments of new for classes without ctor
ML: http://markmail.org/message/4b3mk7jid64zvz34
2016-03-25 19:11:37 +01:00
Andrea Faulds
37c8bb5868 Allow specifying keys on list() elements
Squashed commit of the following:

commit 0361dbe356
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Mar 25 16:59:20 2016 +0000

    UPGRADING and NEWS

commit dca9d4a36c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Mar 25 16:45:18 2016 +0000

    Add tests contributed by @jesseschalken

commit e557f77eab
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Mar 25 16:44:51 2016 +0000

    Rebuild VM

commit 70942e4c3c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Feb 24 13:12:26 2016 +0000

    Add test for evaluation order of nested list() keys

commit ed3592e80c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Feb 24 12:42:04 2016 +0000

    Add test for evaluation order

commit 589756cbcc
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 19 17:29:34 2016 +0000

    Allow arbitrary expressions for key

commit 3f622077c3
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 19 17:45:10 2016 +0000

    Remove compile-time HANDLE_NUMERIC (see bug #63217)

commit bab758119a
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Jan 17 01:20:26 2016 +0000

    Handle numeric strings

commit 14bfe93ddc
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Jan 17 01:09:36 2016 +0000

    Allow trailing comma

commit f4c8b2cb30
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Jan 16 23:47:11 2016 +0000

    Add tests

commit 0085884a61
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Jan 16 22:24:23 2016 +0000

    Handle non-integer/string opcodes

commit e572d2d0ad
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Jan 16 21:10:33 2016 +0000

    Disallow mixing keyed and unkeyed list() elements

commit cede13ccfe
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Jan 10 20:46:44 2016 +0000

    list() with keys (no foreach or tests)
2016-03-25 17:18:42 +00:00
Dmitry Stogov
60b72e434b Avoid data bypass delays between integer and floating point execution units on x86 CPUs. 2016-03-21 13:03:30 +03: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
f3dd50d650 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed test script
  Update NEWS
  Fixed bug #71841 (EG(error_zval) is not handled well)
  Fixed bug #71840 (Unserialize accepts wrongly data)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2016-03-17 15:26:40 +08:00
Xinchen Hui
fe1a3fc08b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #71841 (EG(error_zval) is not handled well)
  Fixed bug #71840 (Unserialize accepts wrongly data)

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/standard/var_unserializer.c
2016-03-17 15:22:44 +08:00
Xinchen Hui
5546f8be56 Fixed bug #71841 (EG(error_zval) is not handled well) 2016-03-17 15:16:47 +08: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
Xinchen Hui
a4b2f7f3a9 Revert "Taking into account "undefined" variables"
This reverts commit 9020086a13.
2016-03-17 11:58:59 +08:00
Xinchen Hui
b9aed47a7a Fixed Bug #71824 (null ptr deref _zval_get_string_func (zend_operators.c:851)) 2016-03-17 11:56:32 +08:00
Dmitry Stogov
9020086a13 Taking into account "undefined" variables 2016-03-16 04:20:43 +03: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
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
Francois Laupretre
370b7039e4 Add support for negative string offsets (syntax) 2016-03-09 14:41:37 +01:00
Nikita Popov
55c0de8f95 Merge branch 'PHP-7.0' 2016-02-24 17:44:33 +01:00
Nikita Popov
3ea877ca15 Fix "Call to member function on unknown"
Should be "on null".
2016-02-24 17:00:25 +01:00
Dmitry Stogov
8a6c5be106 Merge branch 'PHP-7.0'
* PHP-7.0:
  Better fix for bug #71622 (Strings used in pass-as-reference cannot be used to invoke C::$callable())
2016-02-18 23:15:28 +03:00
Dmitry Stogov
25fbb06e2d Better fix for bug #71622 (Strings used in pass-as-reference cannot be used to invoke C::$callable()) 2016-02-18 23:14:46 +03:00
Bob Weinand
2dc9aa9bea Merge branch 'PHP-7.0' 2016-02-18 13:54:19 +01:00
Bob Weinand
3ce6ad9d13 Fixed bug #71622 (Strings used in pass-as-reference cannot be used to invoke C::$callable()) 2016-02-18 13:53:15 +01:00
Xinchen Hui
4eb4a78bf0 Combine conditions (good for other VM kinds) 2016-02-15 11:12:04 +08: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
Nikita Popov
68516091c1 Merge branch 'PHP-7.0' 2016-02-11 16:33:23 +01:00
Nikita Popov
9cebdc5d47 Fix yield-by-ref of constant
Typo in the condition...
2016-02-11 16:32:45 +01:00
Nikita Popov
7453348ca8 Merge branch 'PHP-7.0' 2016-02-11 16:25:55 +01:00
Nikita Popov
1322672c0b Fix dangling send target when using yield from
Also drop some unnecessary TRY_DELREFs -- leftovers from the days
when null was refcounted.
2016-02-11 16:25:16 +01:00
Dmitry Stogov
81721a7ddd Specialize DO_FCALL (and variations) according to used/unused return value 2016-02-05 15:46:52 +03:00