Commit Graph

86883 Commits

Author SHA1 Message Date
Gustavo Frederico Temple Pedrosa
fd045c7021 PowerPC64 support for operators with overflow check
This adds fast architecture-specific implementations of
the following functions for the ppc64:

* fast_increment_function
* fast_decrement_function
2014-12-12 10:47:50 +01:00
Anatol Belski
3affc0e8a2 Fixed bug #68583 Crash in timeout thread
This replaces the GUI element used for execution timeout handling
on Windows. Instead a timer queue technique is used, which is indeed
a thread pool. A timer queue timer is a lightweight object handled
but that thread pool and the timer thread spends most of the time
sleeping and waiting for an alert.

Please note also that this introduces neither binary nor source
breach. The custom timeout thread functions are deleted, however
they was not exported throug DLL, so couldn't be used by any
external code. As well they couldn't be used anywhere in the core
except in executor api, because those custom timeout thread
functions they used to operate on static variables which would
be overwritten (and that would blow).

So instead a relatively modern technique is used for the timeout
handling. It's still not perfect because the executor still has to
check EX(timed_out). This can be a topic for an improvement in
master. But brobably can be tricky as currently it seems to be not
possible to signal an individual thread. Also note another issue
that static variables aren't thread safe, but the current timer
implementation is.
2014-12-12 10:43:31 +01: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
Anatol Belski
de99a94c38 explicit passing of *tsrm_ls isn't needed anymore 2014-12-12 08:11:14 +01: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
Dmitry Stogov
2ea5f7aea4 Removed unused variables 2014-12-12 08:09:42 +03:00
Stanislav Malyshev
97df260b27 update NEWS 2014-12-11 10:41:17 -08:00
Anatol Belski
0323f66fa2 move the test to the right place 2014-12-11 10:39:47 -08:00
Anatol Belski
13f1c276ab Fixed bug #68545 NULL pointer dereference in unserialize.c 2014-12-11 10:39:37 -08:00
Dmitry Stogov
381438e5df Improved array_merge() and array_replace() (1-st array may be added using simple procedure). 2014-12-11 19:18:31 +03:00
Dmitry Stogov
73458e8f19 Replaced zendi_convert_to_long() with _zval_get_long_func() 2014-12-11 15:01:06 +03:00
Dmitry Stogov
27dc5986df Moved zend_is_true() from zend_execute.h/zend_execute_API.c into zend_operators.h/zend_operators.c.
Splited the most expensive part of inline i_zend_is_true() into a separate zend_object_is_true().
Replaced zendi_convert_to_long() with cals to zend_is_true().
2014-12-11 13:18:40 +03:00
Anatol Belski
22be00cb3c TSRMLS_D should be void, thanks Dmitry 2014-12-11 10:03:39 +01: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
Dmitry Stogov
e087d3ac7f Merge branch 'master' into native-tls
* master: (23 commits)
  move the test to the right place
  fix TS build and C89 compat
  updated NEWS
  Fixed bug #68545 NULL pointer dereference in unserialize.c
  Updated NEWS
  Updated NEWS
  Updated NEWS
  NEWS
  Fix bug #68526 Implement POSIX Access Control List for UDS
  Improved basic zval copying primitives: ZVAL_COPY_VALUE(), ZVAL_COPY(), ZVAL_DUP()
  Wrap RETURN_VALUE_USED() with EXPECTED() or UNEXPECTED() macros according to more frequent usage patterns.
  Improved ASSIGN_<OP>, ASSIGN_DIM and UNSET_DIM
  drop dead/unused code
  simplified code
  Move ZVAL_DEREF() and make_real_object() into slow paths.
  Pass znode_op structure by value (it fits into one word) instead of pointer to structure.
  Move checks for references into slow paths.
  Improved ASSIGN_DIM and ASSIGN_OBJ
  Fixed typo
  Move checks for references into slow paths of handlers or helpers. Remove duplicate opcode handlers.
  ...
2014-12-10 23:24:11 +03:00
Anatol Belski
92a9477cc3 Merge branch 'PHP-5.6'
* PHP-5.6:
  move the test to the right place
2014-12-10 13:23:15 +01:00
Anatol Belski
21da246807 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  move the test to the right place
2014-12-10 13:22:52 +01:00
Anatol Belski
c5f7dcd1dc move the test to the right place 2014-12-10 13:19:51 +01:00
Anatol Belski
da78550006 fix TS build and C89 compat 2014-12-10 12:23:46 +01:00
Anatol Belski
aeb30576f6 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #68545 NULL pointer dereference in unserialize.c
  Updated NEWS
  Updated NEWS

Conflicts:
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
2014-12-10 11:54:31 +01:00
Anatol Belski
a96957f0da updated NEWS 2014-12-10 11:49:13 +01:00
Anatol Belski
4a82cdce66 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68545 NULL pointer dereference in unserialize.c

Conflicts:
	ext/standard/var_unserializer.c
2014-12-10 11:47:34 +01:00
Anatol Belski
20d93534d5 Fixed bug #68545 NULL pointer dereference in unserialize.c 2014-12-10 11:43:33 +01:00
Julien Pauli
c4c9f7456b Updated NEWS 2014-12-10 11:24:43 +01:00
Julien Pauli
e6f9059a86 Updated NEWS 2014-12-10 11:23:40 +01:00
Julien Pauli
9a1fc445bf Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS
2014-12-10 11:22:46 +01:00
Julien Pauli
a67a5dc0ad Updated NEWS 2014-12-10 11:22:28 +01:00
Remi Collet
19d481945e Merge branch 'PHP-5.6'
* PHP-5.6:
  NEWS
  Fix bug #68526 Implement POSIX Access Control List for UDS
2014-12-10 08:19:29 +01:00
Remi Collet
eda813fd37 NEWS 2014-12-10 08:19:04 +01:00
Remi Collet
744ada7d9d Fix bug #68526 Implement POSIX Access Control List for UDS
- add --with-fpm-acl build option which allow to manage ACL
on Unix Domain Socket
- add listen.acl_users pool option
- add listen.acl_groups pool option

Keep old behavior (chmod) if option not used or not supported.
2014-12-10 08:15:21 +01:00
Dmitry Stogov
2f3c79b4bf Improved basic zval copying primitives: ZVAL_COPY_VALUE(), ZVAL_COPY(), ZVAL_DUP() 2014-12-09 18:07:39 +03: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
Remi Collet
f0f51da936 drop dead/unused code 2014-12-09 11:25:53 +01: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
Derick Rethans
eb6fb71e55 Merge branch 'PHP-5.6' 2014-12-08 11:07:00 +00:00
Derick Rethans
9d4f4483cb Merge branch 'PHP-5.5' into PHP-5.6 2014-12-08 11:06:50 +00:00
Derick Rethans
4078c35939 Merge branch 'day-of-week-issues' into PHP-5.5 2014-12-08 11:06:41 +00:00
Derick Rethans
5f9a68d3ef Fixed day_of_week function as it could sometimes return negative values internally. 2014-12-08 11:06:12 +00:00
Dmitry Stogov
70a2748b5e Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed possible read after end of buffer and use after free.
2014-12-08 12:25:52 +03:00
Dmitry Stogov
278c38165c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed possible read after end of buffer and use after free.
2014-12-08 12:24:16 +03:00
Dmitry Stogov
e6ad29ae96 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed possible read after end of buffer and use after free.
2014-12-08 12:20:01 +03:00