summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_opcodes.h
Commit message (Collapse)AuthorAgeFilesLines
* Restrict allowed usages of $GLOBALSNikita Popov2021-01-061-1/+2
| | | | | | | | | This restricts allowed usage of $GLOBALS, with the effect that plain PHP arrays can no longer contain INDIRECT elements. RFC: https://wiki.php.net/rfc/restrict_globals_usage Closes GH-6487.
* Disable stack reuse optimization for x86 PIC code. It may clobber local ↵Dmitry Stogov2020-12-011-1/+1
| | | | variable used for Global Offset Table.
* Preallocate stack space for JIT in execute_ex() to eliminate JIT ↵Dmitry Stogov2020-11-301-0/+6
| | | | prologue/epilogue.
* Implement named parametersNikita Popov2020-07-311-1/+2
| | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* Implement nullsafe ?-> operatorIlija Tovilo2020-07-241-1/+2
| | | | | | | | RFC: https://wiki.php.net/rfc/nullsafe_operator Closes GH-5619. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* Implement match expressionIlija Tovilo2020-07-091-1/+4
| | | | | | RFC: https://wiki.php.net/rfc/match_expression_v2 Closes GH-5371.
* Throw Error when writing property of non-objectNikita Popov2019-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | This removes object auto-vivification support. This also means that we can remove the corresponding special handling for typed properites: We no longer need to check that a property is convertible to stdClass if such a conversion might take place indirectly due to a nested property write. Additionally OBJ_W style operations now no longer modify the object operand, and as such we no longer need to treat op1 as a def in SSA form. The next step would be to actually compile the whole LHS of OBJ_W operations in R rather than W mode, but that causes issues with SimpleXML, whose object handlers depend on the current compilation structure. Part of https://wiki.php.net/rfc/engine_warnings.
* Replace ZEND_ASSIGN_ADD (and others) by ZEND_ASSIGN_OP, ZEND_ASSIGN_DIM_OP, ↵Dmitry Stogov2019-07-051-38/+30
| | | | ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP
* Improve zend_binary_assign_op helpers.Dmitry Stogov2019-07-041-27/+27
| | | | Reorder opcode numbers to make ADD-POW and ASSIGN_ADD-ASSIGN_POW opcodes sequencional.
* Optimization of INC/DEC helpersDmitry Stogov2019-07-031-7/+7
|
* Register class before fetching parentNikita Popov2019-06-111-206/+204
| | | | | We want the class declaration to be available while compiling the parent class.
* Implement spread operator in arraysCHU Zhaowei2019-05-131-1/+2
| | | | | | RFC: https://wiki.php.net/rfc/spread_operator_for_array Closes GH-3640.
* Adios, yearly copyright rangesZeev Suraski2019-01-301-1/+1
|
* Implement ??= operatorNikita Popov2019-01-221-1/+2
| | | | | | | | | RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator $a ??= $b is $a ?? ($a = $b), with the difference that $a is only evaluated once, to the degree that this is possible. In particular in $a[foo()] ?? $b function foo() is only ever called once. However, the variable access themselves will be reevaluated.
* Implement typed propertiesNikita Popov2019-01-111-1/+10
| | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists()Michael Moravec2018-12-261-1/+2
|
* Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-3/+3
|
* Keep information about unresolved interfaces in ↵Dmitry Stogov2018-08-231-2/+0
| | | | | | | zend_class_entry->interface_names. Move interface implementation code into ZEND_DECLARE_*CLASS opcodes. Remove ZEND_ADD_INTERFACE and ZEND_VERIFY_ABSTRACT_CLASS opcodes.
* Replace zend_class_entry->traits by persistent zend_class_entry->trait_names.Dmitry Stogov2018-08-231-2/+0
| | | | | Move trait binding code into ZEND_DECLARE_*CLASS opcodes. Remove ZEND_ADD_TRIAIT and ZEND_BIND_TRAITS opcodes.
* Avoid live range references in opcodesNikita Popov2018-02-161-1/+0
| | | | | | | | 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.
* Moved "zval.u2.cache_slot" into free room of "zend_op"Dmitry Stogov2018-02-051-0/+2
|
* Avoid repeatable ARG_SHOULD_BE_SENT_BY_REF() checks in FETCH_*FUNC_ARG and ↵Dmitry Stogov2018-02-051-1/+2
| | | | 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).
* Changed CATCH instruction format (extended_value moved into op2, op2 into ↵Dmitry Stogov2018-01-311-0/+1
| | | | result, result into extended_value)
* Changed FETCH_CONSTANT instruction format (extended_value moved into op1)Dmitry Stogov2018-01-311-1/+1
|
* Changed FETCH_CLASS instruction format (extended_value moved into op1)Dmitry Stogov2018-01-311-1/+0
|
* Use fastcall calling conventionDmitry Stogov2018-01-161-2/+2
|
* year++Xinchen Hui2018-01-021-1/+1
|
* Implement list() reference assignmentsDavid Walker2017-12-091-2/+3
| | | | | | | | Support list() reference assignments of the form: list(&$a, list(&$b, $c)) = $d; RFC: https://wiki.php.net/rfc/list_reference_assignment
* TYPE_CHECK instruction changed. Now it keeps in extended_value a type mask.Dmitry Stogov2017-11-231-0/+1
| | | | This makes check for "boolean" cheaper and allows check combination e.g. (is_string($a) || is_null($a))
* Separate ISSET_ISEMPTY_CV/UNSET_CV from ISSET_ISEMPTY_VAR/UNSET_VARDmitry Stogov2017-07-171-1/+3
|
* Removed vim mode lines. zend_vm_opcodes.h loses these lines after ↵Dmitry Stogov2017-07-171-10/+0
| | | | regeneration. Lines in zend_vm_def.h lead to insertion inthe middle of zend_vm_execute.h.
* further sync for vim mode linesAnatol Belski2017-07-041-0/+10
|
* Added ZEND_FUNC_NUM_ARGS, ZEND_FUNC_GET_ARGS instructions, to implement ↵Dmitry Stogov2017-05-301-1/+3
| | | | | | corresponding builtin functions. Special optimisation for "array_slice(INT, func_get_args())" pattern.
* Added ZEND_GET_CLASS, ZEMD_GET_CALLED_CLASS, ZEND_GET_TYPE instructions, to ↵Dmitry Stogov2017-05-251-1/+4
| | | | implement corresponding builtin functions.
* Added ZEND_COUNT instruction, to implement corresponding builtin.Dmitry Stogov2017-05-251-1/+2
|
* Added ZEND_IN_ARRAY instruction, implementing optimized in_array() builtin ↵Dmitry Stogov2017-05-241-1/+2
| | | | function, through hash lookup in flipped array
* Switch to HYBRID VMDmitry Stogov2017-05-171-1/+6
|
* Implemented HYBRID VM instruction dispatch method that takes advantages of ↵Dmitry Stogov2017-05-031-0/+1
| | | | both CALL and GOTO VMs.
* Implement jumptable optimizationNikita Popov2017-04-101-1/+3
|
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Fixed bug #71539 (Memory error on $arr[$a] =& $arr[$b] if RHS rehashes)Dmitry Stogov2016-07-071-0/+1
|
* Introduce new CHECK_VAR instruction to keep warnings about undefined variables.Dmitry Stogov2016-06-301-0/+1
|
* Implemented RFC: Fix inconsistent behavior of $this variableDmitry Stogov2016-06-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit bdd3b6895c3ce3eacfcf7d4bf4feb8dfa61801fd Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Jun 16 00:19:42 2016 +0300 Fixed GOTO VM commit 2f1d7c8b89ce821086d357cf65f629f040a85c03 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 21:01:57 2016 +0300 Removed unused variable commit cf749c42b0b1919f70b1e7d6dcbfff76899506af Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 19:06:16 2016 +0300 Protection from $this reassign through mb_parse_str() commit 59a9a6c83c66b666971e57f1173b33a422166efd Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 18:14:50 2016 +0300 Added type inference rule for FETCH_THIS opcode commit 73f8d14a856f14a461430b3c7534ab2ce870cbf6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 18:11:18 2016 +0300 Restored PHP-7 behavior of isset($this->foo). It throws exception if not in object context. Removed useless opcode handlers. commit fa0881381e8ae97e022ae5d1ec0851c952f33c82 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 31 12:25:47 2016 +0300 Changed "Notice: Undefined variable: this" into "Exception: Using $this when not in object context". commit e32cc528c0f2c97963d8ec83eff0269f1f45af18 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 02:02:43 2016 +0300 Throw exception on attempt to re-assign $this through extract() and parse_str(). commit 41f1531b52113ec8a4c208aa6b9ef50f1386bb3f Author: Dmitry Stogov <dmitry@zend.com> Date: Mon May 23 22:18:36 2016 +0300 Fixed inconsistent $this behavior
* Split ZEND_SEND_VAR_NO_REF into ZEND_SEND_VAR_NO_REF and ↵Dmitry Stogov2016-05-311-1/+1
| | | | ZEND_SEND_VAR_NO_REF_EX (similar to ZEND_SEND_VAL) and remove ZEND_ARG_* flags.
* Fixed bug #72213 (Finally leaks on nested exceptions).Dmitry Stogov2016-05-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 8461b0407fc9eab0869d43b84e6a92ba2fe06997 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed May 25 00:34:42 2016 +0300 Rmoved zend_try_catch_element.parent and walk through op_array.try_catch_array backward from the current try_cacth_offset. commit 0c71e249649bed178bfbef30bb3e63c57f07af05 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed May 25 00:04:53 2016 +0300 Move SAVE_OPLINE() to its original place commit 111432a4df738fcd65878a42f23194dc3c4983a2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed May 25 00:01:10 2016 +0300 Separate the common part of ZEND_HANDLE_EXCEPTION and FAST_RET into zend_dispatch_try_catch_finally_helper. commit 4f21c06c2ec17819a708bc037f318784554a6ecd Author: Nikita Popov <nikic@php.net> Date: Tue May 24 14:55:27 2016 +0200 Improve finally fix commit da5c7274997b8308e682b5bf280124e3a1483086 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 10:36:08 2016 +0300 Fixed Zend/tests/try/bug70228_3.phpt and Zend/tests/try/bug70228_4.phpt commit cfcedf2fb4f4fc1f7de9f7d53a3037fed7795f19 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 02:59:27 2016 +0300 Added test commit 4c6aa93d43da941eb4fda15b48154bfb104bdc04 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 00:38:20 2016 +0300 Added tests commit 8a8f4704b0eca2e460d42c1f253a363b0db8e510 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon May 23 23:27:34 2016 +0300 Fixed bug #72213 (Finally leaks on nested exceptions)
* Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast ↵Dmitry Stogov2016-05-131-0/+1
| | | | | | | 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.
* Added ability to avoid code generation for useless opcode handlers.Dmitry Stogov2016-03-111-1/+3
| | | | | - SPEC(NO_CONST_CONST) may prevent codegeneration for handlers like ADD_SPEC_CONST_CONST. Compiler and optimizaer should care about constants folding. - SPEC(COMMUTATIVE) generate only single handler instead of two eqivalents like ADD_SPEC_CONST_CV and ADD_SPEC_CV_CONST. Compiler and optimizer should care avout operands swapping.
* Allow usage of "TMPVARCV" pattern for cases when there is no difference in ↵Dmitry Stogov2016-03-111-0/+1
| | | | handling for TMP, VAR and CV operands.
* Consolidate op1/op2 vm flagsNikita Popov2016-01-211-24/+14
|
* Introduced BIND_STATIC opcode instead of ↵Dmitry Stogov2016-01-121-1/+2
| | | | | | 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.