Commit Graph

960 Commits

Author SHA1 Message Date
Dmitry Stogov
cd5ea1619e Micro optimization for better register allocation 2014-12-29 14:21:16 +03:00
Dmitry Stogov
0fa50fb95d Reored conditions 2014-12-29 14:20:52 +03:00
Dmitry Stogov
d909a837e2 Cleanup 2014-12-29 13:38:36 +03:00
Dmitry Stogov
c42ac09518 Added new API function 'zend_string* zend_string_tolower(zend_string*)'.
It simplifies code and avoids unnecessary allocation and copying if string is already in lower case.
2014-12-24 15:04:51 +03:00
Dmitry Stogov
106b1017d4 API for fast construction of packed arrays 2014-12-23 19:08:28 +03:00
Dmitry Stogov
fd4844e079 Removed useless checks 2014-12-22 19:04:29 +03:00
Dmitry Stogov
552c06d439 typo 2014-12-22 12:31:00 +03:00
Xinchen Hui
cc4a198d19 Fixed segfault 2014-12-21 23:18:56 -05:00
Dmitry Stogov
00628afd74 Fixed memory leaks 2014-12-19 19:43:17 +03:00
Nikita Popov
0f815642e0 Drop ZEND_PRINT opcode in favor of ZEND_ECHO
The return value long(1) is an IS_CONST operand now.
2014-12-18 14:39:40 +01:00
Anatol Belski
2eef2abee5 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Optimize argument passing handlers:
  Fix pcre non-FAST_ZPP build

Conflicts:
	Zend/zend_compile.c
	Zend/zend_execute.h
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/pcre/php_pcre.c
2014-12-16 17:13:47 +01:00
Dmitry Stogov
3a18597774 Optimize argument passing handlers:
- predcalculate offsets of passed argument and store it in opline->result.var for ZEND_SEND_*;
- don't update "number of passed arguments" op each ZEND_SEND_* opcode, store it on call frame creation
- Change ZEND_HANDLE_EXCEPTION to determine "number of passed arguments" in incomplete calls fefore freeing
2014-12-16 18:40:52 +03:00
Anatol Belski
209a7a27a5 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Revert "Removed useless local variable"
  Fix the fix for bug #55415
  add BC breaks from PHPNG RFC
  add include for definition of php_url_encode
2014-12-16 08:04:51 +01:00
Dmitry Stogov
caf5521416 Revert "Removed useless local variable"
This reverts commit 44ae32ad55.

It doesn't work properly. We can't access call->scope after free.
2014-12-16 01:44:10 +03:00
Anatol Belski
f62ad3bc57 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  made the apache ini holders to be zend_bool
  Removed useless local variable
  Use simpler functions
  Fixed test
  small fixes to UPGRADING
  Reorder to save alignment size (of course, only for common used structs)
2014-12-15 13:57:43 +01:00
Dmitry Stogov
44ae32ad55 Removed useless local variable 2014-12-15 14:43:30 +03:00
Anatol Belski
e112f6a04e second shot on removing TSRMLS_* 2014-12-14 14:07:59 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Dmitry Stogov
3893c1fc3d Fixed compilation warnings 2014-12-12 21:57:34 +03:00
Dmitry Stogov
14e29f5146 Reduced size of zend_op on 64-bit systems.
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.
2014-12-12 10:19:41 +03:00
Dmitry Stogov
9ea35a37b9 Make ZEND_INIT_FCALL keep predcalculted size of necessary stack space in opline->op1.num to avoid its recalculation on each execution. 2014-12-12 09:01:42 +03:00
Xinchen Hui
634448e2de Revert "Save one xor instr"
This reverts commit bd5c5d3729.
2014-12-11 03:19:33 -05:00
Xinchen Hui
882741639c Merge branch 'master' of https://git.php.net/repository/php-src 2014-12-11 00:03:45 -05:00
Xinchen Hui
bd5c5d3729 Save one xor instr 2014-12-11 00:03:31 -05:00
Anatol Belski
da78550006 fix TS build and C89 compat 2014-12-10 12:23:46 +01:00
Dmitry Stogov
29b9105beb Wrap RETURN_VALUE_USED() with EXPECTED() or UNEXPECTED() macros according to more frequent usage patterns. 2014-12-09 17:07:12 +03:00
Dmitry Stogov
5b3a69c29f Improved ASSIGN_<OP>, ASSIGN_DIM and UNSET_DIM 2014-12-09 15:15:24 +03:00
Dmitry Stogov
98e81e13cf simplified code 2014-12-09 12:17:55 +03:00
Dmitry Stogov
0b19a7c235 Move ZVAL_DEREF() and make_real_object() into slow paths. 2014-12-09 03:05:06 +03:00
Dmitry Stogov
f70545678b Pass znode_op structure by value (it fits into one word) instead of pointer to structure. 2014-12-09 03:03:38 +03:00
Dmitry Stogov
11f7854e75 Move checks for references into slow paths. 2014-12-09 01:09:44 +03:00
Dmitry Stogov
b6c6e7960a Improved ASSIGN_DIM and ASSIGN_OBJ 2014-12-09 00:10:23 +03:00
Dmitry Stogov
0bfc9c6979 Fixed typo 2014-12-08 18:40:37 +03:00
Dmitry Stogov
db4271d332 Move checks for references into slow paths of handlers or helpers. Remove duplicate opcode handlers. 2014-12-08 18:11:14 +03:00
Dmitry Stogov
a555bdf7d1 Removed useless handlers 2014-12-06 03:03:48 +03:00
Dmitry Stogov
5ba4ae7f67 Move checks for references into slow paths of operator functions. Remove duplicate opcode handlers. 2014-12-06 02:14:45 +03:00
Dmitry Stogov
8ab9396adf Get rid of few more duplicate handlers 2014-12-05 18:23:39 +03:00
Dmitry Stogov
e6180ebb64 Improved BOOL, BOOL_NOT and conditional jumps 2014-12-05 17:04:15 +03:00
Dmitry Stogov
62867f008d Improved ECHO and PRINT 2014-12-05 15:07:49 +03:00
Dmitry Stogov
a417ebfc48 Get rid of duplicare FETCH_DIM_* handlers 2014-12-05 13:45:03 +03:00
Dmitry Stogov
c7f695f311 Get rid of duplicate handlers (where the code for IS_TMP_VAR and IS_VAR operands is the same) 2014-12-05 12:40:47 +03:00
Anatol Belski
e04971ce21 fix TS build 2014-12-03 19:50:02 +01:00
Dmitry Stogov
e5716d1b5a Get rid of duplicate handlers (ZEND_ADD_SPEC_TMP_TMP and ZEND_ADD_SPEC_VAR_VAR are absolutely the same). 2014-12-03 18:02:02 +03:00
Dmitry Stogov
5dd427eac2 Use zend_string* for op_array->arg_info[]->name and op_array->arg_info[]->class_name. For internal functions we still use char*. 2014-12-03 16:56:09 +03:00
Dmitry Stogov
631f05f71e Improved POST INC/DEC 2014-12-03 02:47:03 +03:00
Dmitry Stogov
60dbf7b541 Fixed "finally" handling (the bug was introduced by recent removing of EX(delayed_exception)) 2014-12-02 16:05:30 +03:00
Dmitry Stogov
2d39d033e3 Avoid useless dereferences 2014-11-28 19:45:39 +03:00
Dmitry Stogov
38d70aec3e Removed useless check 2014-11-28 16:50:35 +03:00
Dmitry Stogov
1da14c9f81 Pack EX(frame_info) into EX(This).u1.v.reserved. Rename "frame"kind" into "call_kind" and VM_FRAME_... into ZEND_CALL_... 2014-11-28 10:33:03 +03:00
Dmitry Stogov
11384ba77b Pack EX(num_args) into EX(This).u2.num_args 2014-11-28 10:28:49 +03:00