summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
Commit message (Collapse)AuthorAgeFilesLines
* bump yearXinchen Hui2015-01-151-1/+1
|
* Improved access to static property. Now we cache pointers to zval instead of ↵Dmitry Stogov2015-01-131-12/+8
| | | | pointers to property_info.
* trailing whitespace removalStanislav Malyshev2015-01-101-20/+20
|
* Don't count variadic argument in zend_func.common.num_args. This allows ↵Dmitry Stogov2014-12-221-1/+6
| | | | faster CALL/RETURN code.
* first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-47/+46
|
* Reduced size of zend_op on 64-bit systems.Dmitry Stogov2014-12-121-9/+10
| | | | | | | | | | | | | | | the main idea - the smaller the zend_op structure, the lees memory traffic is required to load VM instructions during execution. The patch reduces the size of each opcode from 48 to 32 bytes (saves 16 bytes for each opcode, and applications use thousands of opoceds). This reduced the number of CPU cache misses by 12% and improved performance of real-life apps by 1-2%. The patch affects how constants and jump targets are represented in VM during execution. Previously they were implemented as absolute 64-bit pointers. Now they are relative 32-bit offsets. In run-time constant now should be accessed as: RT_CONSTANT(op_array, opine->op1) instead of opline->op1.zv EX_CONSTANT(opline->op1) instead of opline->op1.zv Jump targets: OP_JMP_ADDR(opline, opline->op2) instead of opline->op2.jmp_addr The patch doesn't change zend_op representation for 32-bit systems. They still use absolute addresses. The compile-time representation is also kept the same.
* Use zend_string* for op_array->arg_info[]->name and ↵Dmitry Stogov2014-12-031-2/+2
| | | | op_array->arg_info[]->class_name. For internal functions we still use char*.
* Revert "Unecessary assignment"Dmitry Stogov2014-12-021-0/+1
| | | | This reverts commit b19333663a872a8b0b8c799781236b5cd5bfa47a.
* Unecessary assignmentXinchen Hui2014-12-021-1/+0
|
* Rename EX_VAR_2() into ZEND_CALL_VAR() and EX_VAR_NUM_2() into ↵Dmitry Stogov2014-11-281-4/+4
| | | | ZEND_CALL_VAR_NUM().
* Changed "finally" handling. Removed EX(fast_ret) and EX(delayed_exception). ↵Dmitry Stogov2014-11-271-0/+11
| | | | Allocate and use additional IS_TMP_VAR slot on VM stack instead.
* Merge branch 'coalesce_operator'Andrea Faulds2014-09-281-0/+1
|\ | | | | | | | | | | | | | | * coalesce_operator: Extended coalesce operator test case for ordering/short-circuiting Ensure not evaluated twice Added test Initial coalesce operator implementation
| * Initial coalesce operator implementationNikita Popov2014-09-161-0/+1
| |
* | Allocate copies of internal functions inherited in user classes at ↵Dmitry Stogov2014-09-231-15/+18
|/ | | | CG(arena), instead of permanent heap (malloc).
* fix signed/unsigned mismatchAnatol Belski2014-09-151-1/+1
|
* Removed ZEND_QM_ASSIGN_VAR and ZEND_JMP_SET_VAR opcodes (in PHPNG they did ↵Dmitry Stogov2014-09-111-1/+0
| | | | exacly the same as ZEND_QM_ASSIGN and ZEND_JMP_SET)
* Use zval_ptr_dtor_nogc to destroy literalsNikita Popov2014-09-031-1/+1
| | | | | Also move the definition of zval_ptr_dtor_nogc to zend_variables.h (from zend_execute.h/.c) as it's used in a few places.
* Reorder fields for better nenory consumtion and data locality on 64-bit systemsDmitry Stogov2014-08-271-2/+1
|
* Use efree_size() instead of efree() where posibleDmitry Stogov2014-08-271-2/+2
|
* Remove ZEND_ACC_INTERACTIVE and CG(interactive)Nikita Popov2014-08-251-17/+4
| | | | | | | | | As far as I can discern these are leftovers of the interactive shell implementation that was used before PHP 5.4. Now the readline ext makes use of normal eval calls for this. So, dropping these until there is evidence to the contrary, as they currently wouldn't work anyway.
* Merge remote-tracking branch 'php-src/master' into astNikita Popov2014-08-251-35/+35
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: Zend/zend_compile.c Zend/zend_compile.h Zend/zend_globals.h Zend/zend_language_parser.y Zend/zend_language_scanner.c Zend/zend_language_scanner.l Zend/zend_types.h
| * master renames phase 2Anatol Belski2014-08-251-23/+23
| |
| * master renames phase 1Anatol Belski2014-08-251-15/+15
| |
| * first shot on merging the core fro the int64 branchAnatol Belski2014-08-161-3/+3
| |
* | Merge branch 'phpng' into astNikita Popov2014-07-221-24/+86
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: Zend/zend_compile.c Zend/zend_compile.h Zend/zend_vm_def.h Zend/zend_vm_execute.h Some of dmitry's optimizations are not merged in yet!
| * Merge branch 'master' into phpngDmitry Stogov2014-07-221-34/+70
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: fix nmake snap when ext name is different in target dll force atoll macro usage on windows Enable $ replacement in exif, ldap, pdo_pgsql and tidy See bug #67635 NEWS NEWS improve previous, add message during configure Fixed bug #67635 php links to systemd libraries without using pkg-config Improve fix for #66608 Fixed segfault with empty break New added opcodes don't need to be resloved Update NEWS Update NEWS Update NEWS Fixed bug #66827 Session raises E_NOTICE when session name variable is array implemented copy libs of core exts in phpize mode fix copy the ext dll into the prefix path in phpize mode fix default prefix in phpize mode fix file with zero size usage in phpize mode Conflicts: Zend/zend_opcode.c Zend/zend_vm_def.h Zend/zend_vm_execute.h ext/session/session.c
| | * Merge branch 'PHP-5.5' into PHP-5.6Xinchen Hui2014-07-191-32/+68
| | |\
| | | * Improve fix for #66608Xinchen Hui2014-07-191-23/+58
| | | |
| | | * Fixed segfault with empty breakXinchen Hui2014-07-191-9/+10
| | | |
| | * | Merge branch 'PHP-5.5' into PHP-5.6Xinchen Hui2014-07-191-2/+2
| | |\ \ | | | |/
| | | * New added opcodes don't need to be reslovedXinchen Hui2014-07-191-2/+2
| | | |
| * | | Merge remote-tracking branch 'origin/master' into phpngXinchen Hui2014-07-181-1/+24
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | Conflicts: Zend/zend_compile.h ext/openssl/xp_ssl.c
| | * | Merge branch 'PHP-5.5' into PHP-5.6Xinchen Hui2014-07-181-1/+24
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | Conflicts: Zend/zend_vm_def.h Zend/zend_vm_execute.h
| | | * Fixed bug #66608 (Incorrect behavior with nested "finally" blocks)Xinchen Hui2014-07-181-1/+24
| | | |
| | | * Bump yearXinchen Hui2014-01-031-1/+1
| | | |
| * | | Suppress warning "cast from pointer to integer of different size"Xinchen Hui2014-07-011-4/+4
| | | |
| * | | Refactored parameter passing mechanism.Dmitry Stogov2014-06-301-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In PHP-5.6 and below each argument passed to user function was copies on VM stack twice. Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack. "Call frame" is actually the same zend_execute_data structure. All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance. There are two minor incompatibilities: 1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}". 2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
| * | | Use arena allocator for zend_class_entry, zend_op_array and ↵Dmitry Stogov2014-06-181-3/+6
| | | | | | | | | | | | | | | | zend_property_info that live till the end of request
| * | | Use absolute addresses as branch targets for NEW, FE_RESET and FE_FETCHDmitry Stogov2014-06-111-0/+3
| | | |
* | | | Preliminary function decl supportNikita Popov2014-07-161-0/+1
| | | | | | | | | | | | | | | | | | | | Problem: __FUNCTION__ etc don't work anymore, due to lexer/parser interdependency.
* | | | AST stage 2.4Nikita Popov2014-06-211-23/+0
|/ / /
* | | Fix ZTS buildNikita Popov2014-05-251-1/+1
| | |
* | | Fixed apply_func_t (they should be broken before)Xinchen Hui2014-05-251-1/+6
| | |
* | | Optimized JMPZNZ to avoid multiplication at runtime (may be it makes sense ↵Dmitry Stogov2014-04-301-0/+4
| | | | | | | | | | | | to use relative addresses everywere it'll lead to Position Independent Code)
* | | Merge mainstream 'master' branch into refactoringDmitry Stogov2014-04-261-0/+3
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During merge I had to revert: Nikita's patch for php_splice() (it probably needs to be applyed again) Bob Weinand's patches related to constant expression handling (we need to review them carefully) I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway) Conflicts: Zend/zend.h Zend/zend_API.c Zend/zend_ast.c Zend/zend_compile.c Zend/zend_compile.h Zend/zend_constants.c Zend/zend_exceptions.c Zend/zend_execute.c Zend/zend_execute.h Zend/zend_execute_API.c Zend/zend_hash.c Zend/zend_highlight.c Zend/zend_language_parser.y Zend/zend_language_scanner.c Zend/zend_language_scanner_defs.h Zend/zend_variables.c Zend/zend_vm_def.h Zend/zend_vm_execute.h ext/date/php_date.c ext/dom/documenttype.c ext/hash/hash.c ext/iconv/iconv.c ext/mbstring/tests/zend_multibyte-10.phpt ext/mbstring/tests/zend_multibyte-11.phpt ext/mbstring/tests/zend_multibyte-12.phpt ext/mysql/php_mysql.c ext/mysqli/mysqli.c ext/mysqlnd/mysqlnd_reverse_api.c ext/mysqlnd/php_mysqlnd.c ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_util_funcs.c ext/opcache/zend_persist.c ext/opcache/zend_persist_calc.c ext/pcre/php_pcre.c ext/pdo/pdo_dbh.c ext/pdo/pdo_stmt.c ext/pdo_pgsql/pgsql_driver.c ext/pgsql/pgsql.c ext/reflection/php_reflection.c ext/session/session.c ext/spl/spl_array.c ext/spl/spl_observer.c ext/standard/array.c ext/standard/basic_functions.c ext/standard/html.c ext/standard/mail.c ext/standard/php_array.h ext/standard/proc_open.c ext/standard/streamsfuncs.c ext/standard/user_filters.c ext/standard/var_unserializer.c ext/standard/var_unserializer.re main/php_variables.c sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg_bp.c sapi/phpdbg/phpdbg_frame.c sapi/phpdbg/phpdbg_help.c sapi/phpdbg/phpdbg_list.c sapi/phpdbg/phpdbg_print.c sapi/phpdbg/phpdbg_prompt.c
| * | add T_POW (**) operatordatibbaw2014-02-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed recognition of the operator Added opcode, still doing multiply instead of pow() opcode now always returns int(42) The right answer, but always a float Yanked code from pow() implementation. Should not handle negative long as exponent ourselves Added test cases from pow() Moved precedence higher than '~' Added GMP operator overloading Added ZEND_ASSIGN_POW (**=) operator. Added pow() as a language construct. Adjusted test cases for changed precedence. Reduced pow() to shell function around ZEND_API pow_function() Reduced test case to only contain edge cases Added overloading test case Moved unary minus above T_POW Revert "Added pow() as a language construct." Bad bad bad idea. This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02. Reverted unary minus behaviour due to previous revert. Convert arrays to int(0) Exponent with array as a base becomes int(0) Rebase against master Fixed tokenizer test case
* | | Use ZEND_HASH_FOEACH_* instead of zend_hash_apply_*Dmitry Stogov2014-04-211-55/+10
| | |
* | | Moved zend_literal->cache_slot right into zval.Dmitry Stogov2014-04-171-9/+9
| | | | | | | | | | | | | | | | | | | | | It should be accessed using Z_CACHE_SLOT() macro. zend_literal structure is removed. API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly. Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
* | | Cleanup (1-st round)Dmitry Stogov2014-04-151-2/+0
| | |
* | | Fixed char*/zend_string* messDmitry Stogov2014-04-011-5/+5
| | |