Commit Graph

944 Commits

Author SHA1 Message Date
Dmitry Stogov
8112e34210 cleanup 2015-11-17 09:59:49 +03:00
Dmitry Stogov
843c165735 Don't undo/redo "pass two" for jump targets in opcache optimizer. 2015-11-17 07:15:35 +03:00
Nikita Popov
e02aea5590 Remove no longer applicable optimization
PHP 7 generates CVs inside silenced blocks.
2015-11-14 11:23:31 +01:00
Dmitry Stogov
3a5fa926bf Squashed commit of the following:
commit afe963e6cc289696e60c6c679796ba2197c52b3b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 13 15:32:29 2015 +0300

    Added news entry

commit a126b891c97848dd7ef8f1abf716328c46e0f19c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Nov 13 15:29:21 2015 +0300

    VERIFY_RETURN_TYPE doesn't have to cleanup operand on exception, bacause now, live temporary variables are released by exception unwinder.

commit 0db475e98786e6bcaa8401ee3e0b33743b9a2f2b
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Nov 12 22:55:39 2015 +0300

    Fixed copy/paste

commit 0ac73fe7174bec9de9a610319a98b259bea67f7f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 11 16:11:50 2015 +0300

    Fixed bug #62210 (Exceptions can leak temporary variables)
2015-11-13 15:35:07 +03:00
Dmitry Stogov
63c4414940 Initialize ctx->optimization_level 2015-11-12 02:46:41 +03:00
Dmitry Stogov
09aa68b294 Break dependency between opcache and optimizer. Remove copatibility macros. 2015-11-12 02:02:24 +03:00
Dmitry Stogov
948b7f5421 Changed ZEND_FREE.op2.num and ZEND_FE_FREE.op2.num back to use live_range_offset (try_catch_offset does't work) 2015-11-11 11:12:44 +03:00
Dmitry Stogov
baf97b1fcc We don't nees zend_op_array->brk_cont_array at run-time anymore.
Move zend_op_array->brk_cont_array into CG(context).brk_cont_array.
Use more compact zend_op_array->live_range instead of zend_op_array->brk_cont_array.
Semantic is kept unchanged.
2015-11-10 21:48:03 +03:00
Dmitry Stogov
86a96f2cf1 Changed meaning of "op2" for ZEND_FREE, ZEND_FE_FREE, ZEND_FAST_CALL, ZEND_FAST_RET.
Previously it was an instruction number.
Now it's an index in op_array->try_cacth_array[].
2015-11-10 19:13:54 +03:00
Nikita Popov
83b1679b6f Merge branch 'PHP-7.0'
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
2015-11-07 17:50:39 +01:00
Nikita Popov
bc3512c1d6 Fix various update_opN_const issues 2015-11-07 17:45:26 +01:00
Nikita Popov
9da456655c Refactor update_op2_const
Combines both switches into one, to avoid having to maintain the same
opcode list twice. This also makes most of the bugs fixed by the next
commit pretty obvious.

No functional change here.
2015-11-07 17:31:09 +01:00
Reeze Xia
568c81809a Merge branch 'PHP-7.0'
* PHP-7.0:
  C99 complain fix
  Update NEWS
  Fixed bug #70876 Segmentation fault when regenerating session id with strict mode
2015-11-07 22:17:10 +08:00
Reeze Xia
c524f43e4f C99 complain fix 2015-11-07 22:15:19 +08:00
Nikita Popov
603c172269 Merge branch 'PHP-7.0'
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
2015-11-07 12:09:20 +01:00
Nikita Popov
99d818f1e9 Don't propagate into ops that error on non-string
To properly support this make update_opN_const fallible -- they
are not always called through replace_with_const.
2015-11-07 12:04:51 +01:00
Nikita Popov
00b37e718d Strip leading backslash in update_opN_const 2015-11-07 12:04:51 +01:00
Nikita Popov
632bee4abb Fix update_opX_const lowercasing
It was lowering in-place.
2015-11-07 12:04:51 +01:00
Xinchen Hui
5385478844 Merge branch 'PHP-7.0' 2015-11-04 19:01:31 +08:00
Xinchen Hui
fe0af271c6 Fixed bug #70843 (Segmentation fault on MacOSX with opcache.file_cache_only=1) 2015-11-04 18:59:30 +08:00
Xinchen Hui
1af0118ff8 Merge branch 'PHP-7.0' 2015-10-26 17:29:22 -07:00
Xinchen Hui
008d8b6789 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:28:19 -07:00
Xinchen Hui
31553f07f2 Revert "Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use)"
This reverts commit 3ef96c2cc6.
2015-10-26 17:26:30 -07:00
Xinchen Hui
0771b46099 Merge branch 'PHP-7.0' 2015-10-26 17:11:16 -07:00
Dmitry Stogov
3e89c883bb Changed ZEND_CLONE->extended_value meaning to relative offset (previously it was absolute opline number) 2015-10-30 14:53:53 +03:00
Dmitry Stogov
4d702c21d0 Merge branch 'PHP-7.0'
* PHP-7.0:
  Don't remap .text segment if huge pages are not available.
2015-10-29 08:45:22 +03:00
Julien Pauli
eb59dd7d81 Don't remap .text segment if huge pages are not available. 2015-10-29 08:44:19 +03:00
Dmitry Stogov
da8e6ec4a5 Fixed incorrect instruction cleanup 2015-10-28 23:10:33 +03:00
Dmitry Stogov
3b44e40277 fixed incorrect bitmask 2015-10-28 21:26:52 +03:00
Dmitry Stogov
eb7be5379d Speed up fetching of class entries for self:: parent:: and static::
This is generalized solution for Bob's idea of speed up self::method() calls without ZEND_FETCH_CLASS.

At first, it adds few new opcodes to separate class related behaviour:
	FETCH_STATIC_PROP_R
	FETCH_STATIC_PROP_W
	FETCH_STATIC_PROP_RW
	FETCH_STATIC_PROP_FUNC_ARG
	FETCH_STATIC_PROP_UNSET
	FETCH_STATIC_PROP_IS
	UNSET_STATIC_PROP
	ISSET_ISEMPTY_STATIC_PROP
	FETCH_CLASS_CONSTANT

At seconds, it enables IS_UNUSED operand to fetch (self, parent or static without separate FETCH_CLASS) for new opcodes and the following ones:
	INIT_STATIC_METHOD_CALL
	NEW
	END_INSTANCEOF

Finaly, opcache optimizer had to be fixed to support new opcodes.
2015-10-28 21:26:52 +03:00
Xinchen Hui
3ef96c2cc6 Fixed bug #70656 (require() statement broken after opcache_reset() or a few hours of use) 2015-10-26 17:09:42 -07:00
Anatol Belski
ccc95bf9df backport 262160e and 2d55e8c into 5.6 2015-10-20 20:05:44 +02:00
Xinchen Hui
d4df6641c8 Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10) 2015-10-17 01:52:32 -07:00
Anatol Belski
ffb5d0aca3 Implemented file_cache_fallback mechanism
which is essential as an attempt to fix the "failed to reattach"
error on Windows. If file_cache is enabled, Opcache will
automaticaly switch to file_cache_only mode in the case a process
failed to map the shared segment at the required address. The
important small part of the SHM will still be mapped, which
allows information exchange between normal processes using SHM
and those using the fallback mechanism.

This is based on Dmitry's, Matt's and mine ideas. So many thanks for
support!
2015-10-09 23:47:59 +02:00
Anatol Belski
a549a3ac17 improve error message 2015-10-04 16:36:53 +02:00
Anatol Belski
c97198e181 fix incrementing on 32-bit 2015-10-04 12:19:16 +02:00
Xinchen Hui
2fb8bb1157 Fixed bug #70632 (Third one of segfault in gc_remove_from_buffer) 2015-10-03 20:33:24 -07:00
Xinchen Hui
4744eec753 Fixed bug #70631 (Another Segfault in gc_remove_from_buffer()) 2015-10-03 20:08:21 -07:00
Xinchen Hui
c147d90dbf Fixed bug #70601 (Segfault in gc_remove_from_buffer()) 2015-10-03 19:38:56 -07:00
Anatol Belski
4cb6342426 remove useless checks
Other platforms than listed in the checks are not supported since
PHP 5.5. We also won't need these checks for a while, so can simplify.
2015-10-03 10:57:32 +02:00
Anatol Belski
96fe3be7f2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix win10 support
2015-10-03 10:46:10 +02:00
Anatol Belski
83bef0ef83 fix win10 support
dwMajorVersion == 10 there, and generally this check is obsolete
as we don't support dwMajorVersion < 6 since 5.5
2015-10-03 10:44:43 +02:00
Dmitry Stogov
a05fc48055 Extended zend_extension API to allow storing additional data associated with op_arrays in opcache SHM. (op_array->reserved[]) 2015-09-25 11:50:38 +03:00
Anatol Belski
67aff16d94 fix ident 2015-09-25 08:30:44 +02:00
Anatol Belski
0fd7acd11d don't keep locked mutex after errors 2015-09-24 16:34:44 +02:00
Anatol Belski
df832c966c avoid dangling pointers 2015-09-24 16:33:58 +02:00
Anatol Belski
3ef3d80f25 move accel_shared_globals assignment into locked block
this might fix crashes under high concurrency
2015-09-24 16:33:57 +02:00
Dmitry Stogov
2d55e8c186 Fix (revert) loop exit condition 2015-09-24 11:19:26 +03:00
Dmitry Stogov
262160e0e9 Attmpt to fix "Unable to reattach to base address" problem. (Matt Ficken) 2015-09-24 10:48:34 +03:00
Dmitry Stogov
233c42ad59 Enabled placing PHP code segment into huge pages 2015-09-15 02:04:09 +03:00
Dmitry Stogov
818e5ea5f7 Enable file based cache compilation by default 2015-09-15 01:58:32 +03:00
Dmitry Stogov
c104d329e1 Use shorter php.ini directive name "opcache.huge_code_pages" and disable it by default. 2015-09-15 01:54:04 +03:00
Dmitry Stogov
f2480582fb Removed useless include 2015-09-15 01:46:53 +03:00
Dmitry Stogov
5c28c21159 Use memcpy() instead of mmap() to keep modifyed code (e.g. gdb breakpoints) 2015-09-14 18:42:45 +03:00
Dmitry Stogov
669f0b39b1 Added an experemental ability to move PHP code pages (PHP TEXT segment) into HUGE pages.
PHP should be configured and built with --enable-huge-code-pages, OS should be configured to provide huge pages.
It's possible to enable/disable this future in php.ini through opcache.enable_huge_code_pages=0/1.
The feature was tested on Linux and provided 2% improvement on real-life apps, because of 2-3 times reduction in number of iTLB misses.
2015-09-14 13:34:17 +03:00
Bob Weinand
fe08b933e4 Add support for **= in opcache optimizer 2015-09-13 12:35:35 +02:00
Anatol Belski
b9155b851e add test for bug #70423 2015-09-07 17:31:49 +02:00
Anatol Belski
46792a9914 remove unnecessary check
as it's unrelated to the size pre calculation
2015-09-07 15:14:26 +02:00
Anatol Belski
eaf96698c7 Fix bug #70423 Warning Internal error: wrong size calculation 2015-09-07 15:02:33 +02:00
Dmitry Stogov
a2f8a7675b Prevent HashTable compaction below HT_MIN_SIZE (this may lead to hash collisions). 2015-09-02 13:03:31 +03:00
Dmitry Stogov
d8eee72a84 Fixed possible caching with invalid key value 2015-09-01 12:56:33 +03:00
Dmitry Stogov
89aa1b7392 Ensure proper data alignment 2015-08-31 13:56:42 +03:00
Xinchen Hui
5a37056efa unnecessary 1 byte allocted 2015-08-21 18:28:02 +08:00
Xinchen Hui
79cd9a18b5 Fixed bug #70237 (Empty while and do-while segmentation fault with opcode on CLI enabled). 2015-08-11 21:01:56 +08:00
Xinchen Hui
6e894f8b81 Merge branch 'PHP-5.6' 2015-08-11 21:44:04 +08:00
Dmitry Stogov
18fb424bef Fixed bug #70207 (Finally is broken with opcache) 2015-08-10 16:38:43 +03:00
Dmitry Stogov
90cb3bb7de Reduce memory usage by using bitsets instead of array of bytes. 2015-08-06 15:41:50 +03:00
Dmitry Stogov
6d681876ee Get rid of memcpy() in MAKE_NOP() 2015-08-06 15:40:40 +03:00
Bogdan Andone
68185bafbe opcache: Patch SSE based fast_memcpy() implementation
Use _mm_store_si128() instead of _mm_stream_si128(). This ensures that copied memory
is preserved in data cache, which is good as the interpretor will start to use this
data without the need to go back to memory. _mm_stream* is intended to be used for
stores where we want to avoid reading data into the cache and the cache pollution;
in our scenario it seems that preserving the data in cache has a positive impact.

Tests on WordPress 4.1 show ~1% performance increase with fast_memcpy() in place
versus standard memcpy() when running php-cgi -T10000 wordpress/index.php.

I also updated SW prefetching on target memory but its contribution is almost negligible.
The address to be prefetched will be used in a couple of cycles (at the next iteration)
while the data from memory will be available in >100 cycles.
2015-07-29 14:51:57 +03:00
Nikita Popov
a717acd21a Fix RECV_VARIADIC literal compacting wrt cache slot 2015-07-26 21:22:31 +02:00
Xinchen Hui
3e479ef424 Fixed bug #70111 (Segfault when a function uses both an explicit return type and an explicit cast) 2015-07-22 22:43:30 +08:00
Anatol Belski
a685953969 fix duplicated line 2015-07-17 20:30:21 +02:00
Anatol Belski
daba578dbe fix file cache path calculation at all the places
moved the corresponding code into a separte function while on that
2015-07-17 15:14:25 +02:00
Anatol Belski
4c87750c26 fix path handling for the file cache 2015-07-17 13:51:16 +02:00
Xinchen Hui
32a4507abc Fixed segfault if opcache is disabled and with file_cache 2015-07-15 10:38:23 +08:00
Xinchen Hui
453ec91dfe Fixed bug #70067 (Cross-compile failure in opcache when SIZEOF_ZEND_LONG < SIZEOF_SIZE_T) 2015-07-14 18:59:36 +08:00
Xinchen Hui
b8eff44b0e Fixed Bug #70058 Build fails when building for i386
(I don't have a m32 build env, so this is not tested)
2015-07-13 15:05:04 +08:00
Dmitry Stogov
ef1b588f6a Resolve GOTO at compile time and replace it with sequnce of FREE/FE_FREE and JMP. 2015-07-10 04:44:21 +03:00
Dmitry Stogov
549e8c4959 Squashed commit of the following:
commit 03cf871f1576f08b2348c141b209894a7bf17a86
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:31 2015 +0300

    Revert "Fixed bug #62210 (Exceptions can leak temporary variables. As a part of the fix serious refactoring was done. op_array->brk_cont_array was removed, and replaced with more general and speed efficient op_array->T_liveliness. ZEND_GOTO opcode is always replaced by ZEND_JMP at compile time). (Bob, Dmitry, Laruence)"

    This reverts commit 5ee8413259.

commit 285a68227ce3d380e821a24fa389aa5239bd3fe1
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:26 2015 +0300

    Revert "Tuned off dubugging of live ranges"

    This reverts commit 404dc93d35.

commit 93d9d11157301ee2ec99afb6f5744b126d17f637
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:17 2015 +0300

    Revert "Remove loop_var_stack"

    This reverts commit b3a4c05071.

commit ede68ebbc284aec79e3f719f2c8dbf9da6907752
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:12 2015 +0300

    Revert "ZEND_SEPARATE reuses temporaries"

    This reverts commit 1852f538b9.

commit 96d8995dc1f517fb01b481736273767509f76c47
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:10 2015 +0300

    Revert "Add assertion in liveliness computation"

    This reverts commit ed14019e8c.

commit 0649d7bfef152e6cc8e67b922534e9946c634d9c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:07 2015 +0300

    Revert "Fixed invalid live-range detection"

    This reverts commit 54f367ee2a.

commit dfe8f3851f6b04595eb089323e3492115a59363e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:04 2015 +0300

    Revert "Add test guaranteeing that loop vars are only freed after potential return type exceptions"

    This reverts commit f5db5a558d.

commit 52a94aad6f48a199358cc07f7e4f56bb73050504
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:45:01 2015 +0300

    Revert "Fixed exception habdling on "return" statement."

    This reverts commit 17c5315bdf.

commit 6e90ad7331901711e89c2ceb2bcab5023e5cee60
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:44:58 2015 +0300

    Revert "Fix too early terminated temporary range with break/cont/goto"

    This reverts commit cc876c04b4.

commit 7b766e44b1970e4031f75109c302c07ead2c05cb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 10 02:44:55 2015 +0300

    Revert "Fixed exception catching on break/continue"

    This reverts commit 8c3f701eeb.
2015-07-10 03:31:52 +03:00
Dmitry Stogov
b77fa94cf9 Disable opcache.fast_shutdown if USE_ZEND_ALLOC=0 2015-07-09 12:19:51 +03:00
Xinchen Hui
249915f938 Add comment to explaining the new check 2015-07-08 17:44:54 +08:00
Xinchen Hui
c6037bd3af Fixed bug #70012 (Exception lost with nested finally block) 2015-07-08 17:15:09 +08:00
Dmitry Stogov
5ee8413259 Fixed bug #62210 (Exceptions can leak temporary variables. As a part of the fix serious refactoring was done. op_array->brk_cont_array was removed, and replaced with more general and speed efficient op_array->T_liveliness. ZEND_GOTO opcode is always replaced by ZEND_JMP at compile time). (Bob, Dmitry, Laruence)
Squashed commit of the following:

commit 38e22106d4
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 15:12:19 2015 +0300

    Added NEWS entry

commit 0a355935bf
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 15:06:32 2015 +0300

    Inline function, to eliminate repeatable checks

commit d937584f3a
Merge: 0341626 32677f5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 14:35:49 2015 +0300

    Merge branch 'master' into temporary_cleaning

    * master:
      Fixed bug #70006 (cli - function with default arg = STDOUT crash output).
      Fix x86 build
      Fixed use after free on closure_call_leak_with_exception.phpt
      Fixed test

commit 0341626ea9
Merge: 74869fa dec35de
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 12:00:53 2015 +0300

    Merge branch 'temporary_cleaning' of https://github.com/laruence/php-src into temporary_cleaning

    * 'temporary_cleaning' of https://github.com/laruence/php-src:
      Fixed checkpoint get
      Fixed crash of invalid pointer derefer
      cleanup

commit 74869fa673
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 11:45:34 2015 +0300

    Fixed wrong GOTO resolution

commit dec35ded32
Author: Xinchen Hui <laruence@gmail.com>
Date:   Tue Jul 7 15:58:49 2015 +0800

    Fixed checkpoint get

commit b0f419540a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 10:47:11 2015 +0300

    Fixed crash of invalid pointer derefer (laruence)

commit 7a428d98ca
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 10:35:47 2015 +0300

    Fixed identation

commit 9c3a4dce9c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 10:33:52 2015 +0300

    Fixed invalid size

commit 653abc670b
Author: Xinchen Hui <laruence@gmail.com>
Date:   Tue Jul 7 11:29:14 2015 +0800

    Fixed crash of invalid pointer derefer

commit e04500ceda
Author: Xinchen Hui <laruence@gmail.com>
Date:   Tue Jul 7 11:28:26 2015 +0800

    cleanup

commit 34183e1687
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 04:49:46 2015 +0300

    op_array->T_liveliness compression

commit 2f6ad84579
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 04:44:44 2015 +0300

    White spaces

commit be83f115a3
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 04:42:26 2015 +0300

    Identation

commit 1f5084b990
Merge: 91b620d 1adf3df
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 04:41:54 2015 +0300

    Merge branch 'master' into temporary_cleaning

    * master:
      Throw TypeError for invalid callback
      Fix crash when exception occurs during nested rope
      Fix crash when exception is thrown during ROPE_END
      Small cleanup in ternary compilation
      move the define to the right place
      fix ext/ldap build
      Rectify information about invalid shift warning being now ArithmeticError

commit 91b620d684
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 04:32:04 2015 +0300

    Replace GOTO by FREE/FE_FREE and JMP at compile time

commit 7052e56979
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Jul 7 02:25:08 2015 +0300

    Use zend_regenerate_var_liveliness_info() to regenerate information after pass two.

commit ae72b0dc67
Merge: a81c4bb a919fe8
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 21:02:34 2015 +0300

    Merge branch 'master' into temporary_cleaning

    * master:
      Do not display EXT_TYPE_UNUSED in phpdbg opcodes
      Run debug build with opcache on travis

commit a81c4bb8c6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 20:59:34 2015 +0300

    Improved algorithm. It's actually the same algorithm with second loop removed and simpler temporary data structures. The only difference may be in "re-defined" vatriable handling. Now live-range in that case started from the seconnd definition (this must be more safe).

commit 9a16810f7a
Merge: bbfbe47 001ecd3
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 17:57:45 2015 +0300

    Merge branch 'master' into temporary_cleaning

    * master:
      Simplify TMP var number decoding (without HashTable)

commit bbfbe470c8
Merge: 0bda4ab 436b01e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 17:02:01 2015 +0300

    Merge branch 'master' into temporary_cleaning

    * master:
      Avoid dangerous optimization
      Fixed JMPZNZ instruction printing
      Attempt at falling back on ldap_find_control for Mac OS

commit 0bda4abea7
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 16:05:33 2015 +0300

    Fixed live-range construction for OP_DATA opcode
    Added comments about algorithm assumtions

commit 521ad9df98
Merge: 4398dab a09dcb0
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Mon Jul 6 14:54:15 2015 +0200

    Merge branch 'master' of https://github.com/php/php-src into temporary_cleaning

commit 4398dab82f
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Mon Jul 6 13:51:27 2015 +0200

    Add a few phpt tests related to temporary cleaning

commit 739656f83f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 14:28:49 2015 +0300

    Fixed Zend/tests/foreach_004.phpt failure (FE_FETCH shouldn't be included into TMP vatriablr live range)

commit 3df462a2bc
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 13:41:02 2015 +0300

    Improve data layout (reduce the op_array structure size on 64-bit systems)

commit 883b73c56e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Jul 6 13:28:45 2015 +0300

    Removed op_array->brk_cont_array

commit ae5e58b598
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Mon Jul 6 04:22:58 2015 +0200

    Fix bug with brk_cont variable free / free loop vars via temporary liveliness info

commit b4223ca627
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Mon Jul 6 04:07:07 2015 +0200

    Fix bugs / cleanup fixes

commit ea33189d22
Author: Xinchen Hui <laruence@gmail.com>
Date:   Sun Jul 5 20:58:38 2015 +0800

    Removed useless TsTop

commit 1dbb007e4a
Merge: 550bbf8 3a8af24
Author: Xinchen Hui <laruence@gmail.com>
Date:   Sat Jul 4 15:06:44 2015 +0800

    Merge branch 'temporary_cleaning' of https://github.com/dstogov/php-src into temporary_cleaning

commit 3a8af24529
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 3 16:15:36 2015 +0300

    More exceptions from regular liveliness analyses (with explanation in comments).
    Mark old "unexplained" exceptions with ???.

commit ba721efa2c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 3 14:16:09 2015 +0300

    Print list of live temp variables (at least for internal debugging)

commit 8d1f88fe91
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 3 13:31:56 2015 +0300

    Use op_array->T_liveliness to free incomplete ropes and restore error_reporting level on exception

commit 80c1d0d779
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jul 3 11:05:39 2015 +0300

    Don't keep empty T_liveliness

commit 501ae8aaac
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jul 2 22:31:48 2015 +0300

    Reverted changes to Zend/zend_arena.h.
    Reuse CG(arena) instead of creating a new one.

commit a4fce36907
Merge: 6ff7246 fd0fcce
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jul 2 22:01:42 2015 +0300

    Merge branch 'temporary_cleaning' of github.com:bwoebi/php-src into temporary_cleaning

    * 'temporary_cleaning' of github.com:bwoebi/php-src:
      Fix remaining issues with compacted temporaries
      Fix regression from last commit (+1 ?!)
      Fix off-by-one (opcache may remove last ZEND_RETURN)
      Speed algorithm up, more fail safety when reusing temporaries
      Dumb bug in opcode.c (forgot to update Ts[i])
      Fix opcache support
      Exempt ROPE temporaries from freeing
      Hmm, we need temporary info for all the opcodes
      Add opcache support for cleaning in optimization step (Opcache seems to have a few unrelated issues which blow up together with that patch)
      Add proper temporary cleaning upon frame abortion
      Fix arena on small sizes (size < sizeof(zend_arena))

commit fd0fcce811
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Thu Jul 2 20:00:33 2015 +0200

    Fix remaining issues with compacted temporaries

commit 427dc58bbb
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Wed Jul 1 22:49:12 2015 +0200

    Fix regression from last commit (+1 ?!)

commit 1adcf56a6e
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Wed Jul 1 22:17:07 2015 +0200

    Fix off-by-one (opcache may remove last ZEND_RETURN)

commit 25b231b784
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Wed Jul 1 20:59:24 2015 +0200

    Speed algorithm up, more fail safety when reusing temporaries

commit 22d9d05350
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Wed Jul 1 16:48:46 2015 +0200

    Dumb bug in opcode.c (forgot to update Ts[i])

commit 6538269bfa
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Wed Jul 1 13:05:52 2015 +0200

    Fix opcache support

commit 333a7c4a88
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Sat Jun 27 22:40:21 2015 +0200

    Exempt ROPE temporaries from freeing

commit 02585f7708
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Fri Jun 26 16:20:55 2015 +0200

    Hmm, we need temporary info for all the opcodes

commit cbcaedbd78
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Fri Jun 26 01:04:09 2015 +0200

    Add opcache support for cleaning in optimization step
    (Opcache seems to have a few unrelated issues which blow up together with that patch)

commit fef649f406
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Fri Jun 26 01:02:27 2015 +0200

    Add proper temporary cleaning upon frame abortion

commit 1cec2e7271
Author: Bob Weinand <bobwei9@hotmail.com>
Date:   Thu Jun 25 23:33:21 2015 +0200

    Fix arena on small sizes (size < sizeof(zend_arena))
2015-07-07 15:41:12 +03:00
Dmitry Stogov
436b01e379 Avoid dangerous optimization 2015-07-06 16:52:38 +03:00
Dmitry Stogov
fa1abb5677 Fixed memory leak because of incorrect 'if ();' optimization 2015-07-02 02:00:34 +03:00
Dmitry Stogov
a0b55e6a37 Cleanup (updated comments about optimization of comparison with IS_NULL) 2015-07-01 16:31:20 +03:00
Dmitry Stogov
e2baf737ae Cleanup (we don't use is_ref=1/refcount=2 trick to trigger COW in PHP-7) 2015-07-01 16:15:45 +03:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
dc588997e2 On Windows PHP may be restarted with different set of DSO extensions without SHM reset.
This may make optimisation for entities from DSO extensions inconsistent.
2015-06-29 18:01:01 +03:00
Dmitry Stogov
ee1e67fae6 On Windows PHP may be restarted with different set of DSO extensions without SHM reset.
This may make optimisation for entities from DSO extensions inconsistent.
2015-06-29 17:45:56 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Dmitry Stogov
625dba022c Don't evaluate invalid constant expressions. 2015-06-29 11:35:12 +03:00
Bob Weinand
4a4529adb0 Fix rope memory leaks upon exception 2015-06-28 15:42:15 +02:00
Anatol Belski
658d698a1c add test for bug #69838 2015-06-20 09:35:02 +02:00
Anatol Belski
f88aad418e Fix bug #69838 OPCACHE Warning Internal error: wrong size calculation
This chunk is pre calculated with aligned size, so should it use it
at run time.
2015-06-20 09:35:01 +02:00
Anatol Belski
269acaa363 Merge branch 'pull-request/1284'
* pull-request/1284:
  Rename interface macros
  Fix typo in UPGRADING
  Move definition of Throwable to zend_exceptions.h/c
  Check for zend_ce_throwable instead
  Fix some missed tests
  Add Throwable tests
  Fix previous exception type check
  Updated UPGRADING with RFC link
  Changed AssertionException to AssertionError
  Update exception error messages
  Throwable method signatures.
  Update exception names in tests after formatting changes.
  Merge exception formatting changes.
  Make zend_get_exception_base static.
  Fix a few missed tests.
  Fix handler double copy.
  Updated tests to reflect exception class changes.
  Remodel exceptions based on Throwable interface
2015-06-17 21:55:03 +02:00
Xinchen Hui
e011e6fdf4 Add a comment 2015-06-17 17:33:55 +08:00
Dmitry Stogov
a524a375d9 Improved class type hints checks, by caching resolved class entries in run-time cache. 2015-06-17 12:07:43 +03:00
Aaron Piotrowski
77cf6d81b4 Fix some missed tests 2015-06-15 08:20:30 -05:00
Bob Weinand
6e3e1e31e9 Add phpdbg to allowed cli-SAPIs in opcache 2015-06-15 12:31:46 +02:00
Dmitry Stogov
0a21a0c752 Removed opcache.load_comments configuration directive. Now doc comments loading costs nothing and always enabled. 2015-06-15 13:18:52 +03:00
Bob Weinand
7c2a0157c7 Cache the class_name typehint key in arg_info
This leads to up to 2% improvement on one tested real world application by not having to always recalculate the lowercased string and its hash
2015-06-12 17:26:53 +02:00
Dmitry Stogov
869f662cdd Use better zend_hash_* functions 2015-06-05 13:54:57 +03:00
Anatol Belski
cfadcfc734 cleanup more redundant S_IS* declarations 2015-05-25 18:03:26 +02:00
Nikita Popov
8542befa7b Remove ZEND_BRK/ZEND_CONT from VM
These are no longer used at run-time now, only temporarily during
compilation.
2015-05-23 10:51:33 +02:00
Nikita Popov
9325ada725 Embed break/continue depth into opline
Previously a separate lval literal was used - this is probably a
leftover from the time where the break level could still be
specified dynamically.
2015-05-23 10:51:33 +02:00
Xinchen Hui
50688e3984 Forgot the test for bug #69688 2015-05-22 11:50:55 +08:00
Xinchen Hui
95da6b76f3 Fixed test 2015-05-22 11:49:15 +08:00
Xinchen Hui
8c0ba65d6a Fixed bug #69688 (segfault with eval and opcache fast shutdown) 2015-05-22 11:48:13 +08:00
Dmitry Stogov
f186d4b8b1 Fixed build with DEBUG_COMPACT_LITERALS=1 2015-05-21 17:57:06 +03:00
Dmitry Stogov
0da206e4b7 Set proper type_info flags. 2015-05-21 00:51:34 +03:00
Dmitry Stogov
cf6ac5c665 Fixed SHM+FILE cache with opcache.protect_memory=1 2015-05-20 23:33:55 +03:00
Dmitry Stogov
5ff5201543 Improved script copyining from SHM to process memory 2015-05-20 23:12:04 +03:00
Dmitry Stogov
6c8d49b6b0 Improved hash table copying 2015-05-19 13:22:58 +03:00
Dmitry Stogov
d72a94468e Merged FE_FETCH_R[W] with the following ASSIGN[_REF] when assigne to CV. 2015-05-13 12:55:42 +03:00
Dmitry Stogov
7e5aa6b2ea Removed deprecated conditions 2015-05-13 10:09:06 +03:00
Dmitry Stogov
06ef3aa6b0 Fixed string handling (string cached in SHM marked as permanent, strings stored in CG(arena) as not)
Fixed anonymous class support
2015-05-12 13:45:52 +03:00
Dmitry Stogov
e6976e9ba2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF)
2015-05-07 12:17:55 +03:00
Dmitry Stogov
329513c3a7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF)

Conflicts:
	NEWS
2015-05-07 12:16:40 +03:00
Dmitry Stogov
8026001943 Fixed bug #69549 (Memory leak with opcache.optimization_level=0xFFFFFFFF) 2015-05-07 12:14:14 +03:00
Dmitry Stogov
9e9170bd07 Strings and other pointers should be handled differently 2015-05-07 11:36:01 +03:00
Rasmus Lerdorf
dd0b602381 Fix build 2015-05-06 22:46:56 -07:00
Xinchen Hui
809616c9da Temporary fix for SIGFPE 2015-05-07 11:25:04 +08:00
Dmitry Stogov
3abde43231 Added experimental (disabled by default) file based opcode cache. 2015-05-06 23:46:49 +03:00
Xinchen Hui
24992a1422 Merge branch 'PHP-5.5' into PHP-5.6 2015-05-05 11:06:14 +08:00
Xinchen Hui
cf3e976c3b Update version 2015-05-05 11:06:04 +08:00
Dmitry Stogov
5af7743cf5 Merge branch 'anon'
* anon:
  Pass class_entry through IS_VAR to avoid hash lookup in ZEND_NEW.
  Use "safe" anonymous class names. Don't show the mangled names through var_dump().
  Refactored using specialized opcodes
  Fix implementing_class handling
  More cleanup (mainly retab)
  Don't issue FETCH_CLASS for anon classes
  More retab
  Simply anon class name generation
  Retab
  Revert unrelated changes / rebase fixup
  Rebase Joe's anon classes implementation
2015-04-27 17:18:35 +03:00
Dmitry Stogov
ffe804a50c Use new hash iteration API. 2015-04-27 16:50:47 +03:00
Dmitry Stogov
94245bc14c Refactored using specialized opcodes 2015-04-27 12:24:39 +03:00
Dmitry Stogov
6265687768 Added HashTable flag HASH_FLAG_STATIC_KEYS that is maintaned to be set if all hash table keys are numbers or interned strings.
Take this flag into account when copy or destroy HashTable to avoud useless checks for each key.
2015-04-24 09:34:50 +03:00
Xinchen Hui
9db4e25927 Since 5.6 stat.cwd using emalloc (Thanks to Remi) 2015-04-22 15:14:00 +08:00
Dmitry Stogov
770cb1da71 Keep realpath and PCRE caches in consistency with opcache SHM. 2015-04-22 02:29:06 +03:00
Dmitry Stogov
a0c07c90f2 Fixed zend_string related inconsistencies 2015-04-21 23:26:34 +03:00
Dmitry Stogov
ca76a86fe6 Removed deprecated code 2015-04-21 11:48:43 +03:00
Dmitry Stogov
81a9505742 Compact HashTables to reduce SHM usage 2015-04-21 00:27:21 +03:00
Dmitry Stogov
b1a03d7d39 Removed invalid code 2015-04-20 16:48:49 +03:00
Xinchen Hui
5255ea42b5 What should we version the bundled opcache? 2015-04-14 16:20:01 +08:00
Dmitry Stogov
52eac6bf11 Improved "fust shutdown". 2015-04-03 10:48:55 +03:00
Xinchen Hui
ed43b7a548 Merge branch 'PHP-5.6'
Conflicts:
	ext/opcache/zend_accelerator_module.c
2015-04-02 00:04:30 +08:00
Xinchen Hui
2533fde199 Merge branch 'PHP-5.5' into PHP-5.6 2015-04-01 23:59:45 +08:00
Danack
86f983bd3e Fixed bug #69281 (opcache_is_script_cached no longer works) 2015-04-01 23:58:22 +08:00
Lior Kaplan
c22543b3f3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68739 (Missing break / control flow in curl)
  Fixed bug #68740 (NULL Pointer Dereference)
  Fixed bug #68677 (Use After Free in OPcache)
2015-04-01 01:54:53 +03:00
Xinchen Hui
0a8f28b432 Fixed bug #68677 (Use After Free in OPcache)
(cherry picked from commit 777c39f404)
2015-04-01 01:24:16 +03:00
Xinchen Hui
5c31c8c6e5 Fixed is_callable/function_exists with disable_functions 2015-03-28 17:07:11 +08:00
Xinchen Hui
e60b380c55 Merge branch 'bug69315' of https://github.com/laruence/php-src 2015-03-28 14:10:41 +08:00
Kalle Sommer Nielsen
dd601e661c Remove these CFLAGS for ereg in opcache, we don't use them anymore (as opcache uses PCRE) together with ereg being gone 2015-03-27 15:01:31 +01:00
Xinchen Hui
84d9426730 Fixed bug #69315 2015-03-27 17:50:36 +08:00
Kalle Sommer Nielsen
67b907f059 Change the error message for colliding class/interface/trait names to be a little more clearer.
C:\> php -r "interface stdClass { }"
  Error: Cannot declare interface stdClass, because the name is already in use in Command Line Code on line 1
2015-03-26 01:44:23 +01:00
Xinchen Hui
6aaee5fc14 Merge branch 'PHP-5.6'
Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2015-03-25 23:35:56 +08:00
Xinchen Hui
d380d1cb1b Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function)
is_callable returns true for disable_functions, but function_exists
return false for it.
2015-03-25 23:34:02 +08:00
Xinchen Hui
e46e9a3d22 Fixed Bug #69297 (function_exists strange behavior with OPCache on disabled function)
is_callable returns true for disable_functions, but function_exists
return false for it.
2015-03-25 23:29:18 +08:00
Kalle Sommer Nielsen
927d53fda4 Change "Cannot redeclare class X" into "Cannot redeclare class/interface/trait X", meaning that the following:
C:\> php -r "trait A { } trait A { }"

Will now properly print "Cannot redeclare trait A" instead of "Cannot redeclare class A" to make error messages a tiny bit clearer. Admittedly, a better solution can most likely be made by actually telling what the colliding object is a type of.

Internally this adds a new function:
 zend_get_object_type()
2015-03-25 06:31:11 +01:00
Kalle Sommer Nielsen
a3d2f9b600 The error message is actually "Cannot", not "Can't" 2015-03-25 05:20:58 +01:00
Dmitry Stogov
e37e9d2986 Reverted part committed by mistake 2015-03-24 22:56:07 +03:00
Dmitry Stogov
23c33b1483 Optimized strings concatenation.
ZEND_ADD_STRING/VAR/CHAR are replaced with ZEND_ROPE_INTI, ZEND_ROPE_ADD, ZEND_ROPE_END.
Instead of reallocation and copying string on each ZEND_ADD_STRING/VAR/CAHR, collect all the strings and then allocate and construct the resulting string once.
2015-03-24 22:47:21 +03:00
Xinchen Hui
775a257cef Only used in ZTS 2015-03-21 13:58:29 +08:00
Dmitry Stogov
0a6bb2dfd4 Fixed optimization patterns 2015-03-20 05:24:04 +03:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Dmitry Stogov
d092cb6e8e Second prefetch is useless, because cahce line on modern x86 CPUs is 64 bytes long. 2015-03-18 17:11:21 +03:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
2b42d71908 Changed HashTable layout:
Removed HashTable->arHash (reduced memory consumption). Now hash slots may be accessed using HT_HASH() macro.
Hash slotas are allocated together with Buckets (before them) and lay in reverse order from HashTable->arData base address (see comments in Zend/zend_types.h)
Indexes in hash table and conflict resolution chains (Z_NEXT) may be stored as indeces or offsets in bytes, depending on system (32 or 64-bit).
HashTable data filelds are reordered to keep the most useful for zend_hash_find() data in the same CPU cache line.
2015-03-13 17:13:19 +03:00
Dmitry Stogov
6289f7e52f Executor cleanup: fix GOTO and SWITCH VMs, remove aility to build additional PHP-5.0 compatible VM, hide executor implementation details. 2015-03-12 20:39:04 +03:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Dmitry Stogov
5d0bacfe67 Merge branch 'PHP-5.6'
* PHP-5.6:
  We don't cache custom strems with callbacks anymore

Conflicts:
	ext/opcache/ZendAccelerator.c
2015-03-10 19:32:38 +03:00
Dmitry Stogov
b52a2940af Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  We don't cache custom strems with callbacks anymore
2015-03-10 19:30:32 +03:00
Dmitry Stogov
c814b3294a We don't cache custom strems with callbacks anymore 2015-03-10 19:25:30 +03:00
Dmitry Stogov
53d8e5fc63 Improved hash key manangement code 2015-03-06 16:26:40 +03:00
Dmitry Stogov
4bc7ee2eb7 Fixed conditions 2015-03-06 11:00:19 +03:00
Dmitry Stogov
8308e617f1 Revert "Fix logical-op-parentheses warning"
This reverts commit b7408234b9.
2015-03-06 10:56:19 +03:00
Reeze Xia
b7408234b9 Fix logical-op-parentheses warning
What a condition ;-)
2015-03-06 12:20:01 +08:00
Dmitry Stogov
28e42b1ded Improved hash key manangement code 2015-03-06 02:13:47 +03:00
Dmitry Stogov
6d065a8545 Avoid repeatable strlen() calls 2015-03-05 18:18:39 +03:00
Dmitry Stogov
8e3643a8fc Avoid useless op_array duplication 2015-03-05 14:23:48 +03:00
Anatol Belski
45fb8b517c fix incompatible pointer 2015-03-05 12:01:27 +01:00
Adam Harvey
d8b2012ab0 Explicitly depend opcache on pcre. 2015-03-05 00:27:36 +00:00
Adam Harvey
fea9a6fc77 Merge remote-tracking branch 'datibbaw/kill-ereg'
Conflicts:
	ext/ereg/config.w32
	ext/ereg/config0.m4
	ext/ereg/ereg.c
	ext/ereg/php_ereg.h
	ext/ereg/php_regex.h
	ext/ereg/regex/engine.c
	ext/ereg/regex/main.c
	ext/ereg/regex/regcomp.c
	ext/ereg/regex/regerror.c
	ext/ereg/tests/split_error_002.phpt
	ext/ereg/tests/split_variation_003.phpt
	ext/ereg/tests/spliti_error_002.phpt
	ext/ereg/tests/spliti_variation_003.phpt
	ext/pgsql/pgsql.c
	sapi/apache/php_apache_http.h
	sapi/apache_hooks/php_apache_http.h
2015-03-05 00:21:38 +00:00
Dmitry Stogov
8ec8648c91 Improved code for class property inheritance 2015-03-04 17:41:01 +03:00
Xinchen Hui
ec00a4de4e Merge branch 'PHP-5.6' 2015-03-04 14:49:03 +08:00
Xinchen Hui
a29b64fc10 Fixed bug #69159 (Opcache causes problem when passing a variable variable to a function) 2015-03-04 14:48:41 +08:00
Dmitry Stogov
2fa8d67a5c Use zend_string* instead of char* for opened_patch handling. Avoid reallocations and improve string reuse. 2015-03-04 02:05:28 +03:00
Xinchen Hui
4ccbb1ed33 Merge branch 'PHP-5.6' 2015-03-03 23:17:49 +08:00
Xinchen Hui
6183408031 Merge branch 'PHP-5.5' into PHP-5.6 2015-03-03 23:17:37 +08:00
nathan r. hruby
837eeefee9 Make killing a locker an ERROR event
At least in apache, killing a locker with SIGKILL from inside opcache prevents
the child process from emitting a corresponding log event to the access or
error logs, therefore requests are termed with no record.  This makes is
incredibly difficult to debug problems espically on systems with high counts
of cache restarts.  Since INFO level is far too noisy for production use,
switch the killing to a higher level so we can see it easier.
2015-03-03 23:16:45 +08:00
Dmitry Stogov
9a20323e19 Improved assert() according to expectations RFC.
See https://wiki.php.net/rfc/expectations

Squashed commit of the following:

commit 3f3651a787
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Mar 2 11:56:33 2015 +0300

    opcode 137 is used for ZEND_OP_DATA and con't be reused for ZEND_ASSERT_CHECK

commit ca8ecabf2a
Merge: 24328ac 9dac923
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Mar 2 10:49:23 2015 +0300

    Merge branch 'master' into assert

    * master:
      Update NEWS
      Fixed bug #69139 (Crash in gc_zval_possible_root on unserialize)
      windows only test
      Align entries format
      Align entries format for 5.6.7
      Align entries format for 5.5.23
      Bump header year
      Fixed bug #69144 (strtr not replacing with partly matching replace pairs)
      Fixed test?
      Revert mktime()/gmmktime()'s arginfo
      Update NEWS
      Fixed bug #69141 Missing arguments in reflection info for some builtin functions
      Add NEWS entry
      Remove useless date warning
      Fix ARG_INFO for levenshtein
      Fix ARG_INFO for levenshtein
      fix dir separator in tests
      Update NEWS
      Fixed bug #69085 (SoapClient's __call() type confusion through unserialize()).

commit 24328ac03f
Merge: 021fd94 1cdee9a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Feb 27 15:57:13 2015 +0300

    Merge branch 'master' into assert

    * master:
      Fixed C++ support
      Fixed bug #69115 crash in mail
      Reorder
      Update NEWs
      Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build)
      Update News
      Fixed bug #69125 (Array numeric string as key)
      fix bug#68942's patch
      Fixed ability to build unspecialized executor
      Fixed bug #69124 (method name could not be used when by ref)
      Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
      Fixed a bug that header value is not terminated by '\0' when accessed through getenv().

commit 021fd94ed1
Merge: 49963eb ace1f82
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Feb 26 11:26:03 2015 +0300

    Merge branch 'master' into assert

    * master: (59 commits)
      Improved ASSIGN_DIM handler
      Don't inline slow path
      Revert a part committted by mistake
      Fixed compilation warnings
      Fixed a bug that header value is not terminated by '\0' when accessed through getenv().
      better name
      Improve fix for #69038
      Update NEWs
      Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage)
      Added specialized versions of DO_FCALL handler:   DO_ICALL - for internal functions   DO_UCALL - for user functions   DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods)
      Use cache_slot offsets instead of indexes (simplify run-time instructions)
      Split INIT_FCALL_BY_NAME inti INIT_FCALL_BY_NAME(CONST+STRING) and INIT_DYNAMIC_CALL(CONST-STRING|TMPVAR|CV)
      Support list($a, $b) = $a
      Avoid unnecassary check
      Make zend_array_destroy() to free the corresponding zend_array
      Eliminate check on the fast path
      Make current() and key() receive argument by value.
      Use Firebird default home folder, replace Interbase with Firebird
      Updated NEWS
      updated NEWS
      ...

    Conflicts:
    	Zend/zend_vm_execute.h
    	Zend/zend_vm_opcodes.c
    	Zend/zend_vm_opcodes.h

commit 49963ebf9d
Merge: 07b1f92 6b77959
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Feb 19 11:13:08 2015 +0300

    Merge branch 'master' into assert

    * master:
      Implemented AST pretty-printer
      update NEWS to match the actual stuff in 5.6.6
      update NEWS to match the actual stuff in 5.5.22
      update NEWS(add missing entry for the enchant fix, and reorder the entries a bit)
      fix typo in bug#
      update NEWS
      fix email format
      update NEWS
      update 5.6.6 release date in NEWS
      Fix bug #69033 (Request may get env. variables from previous requests if PHP works as FastCGI)
      BFN
      fix test
      fix test
      fix test
      Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
      Updated NEWS
      add CVE
      5.4.39 next
      Fix associativity to match Perl
      Blast off to space.

    Conflicts:
    	Zend/zend_ast.c

commit 07b1f92ed6
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 23:06:32 2015 +0300

    fixed pretty-printer (support for "elseif")

commit 5a976c8d85
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 19:50:08 2015 +0300

    Fixed vaeious ptetty-printer issues

commit 69491e8e8e
Merge: 8473157 3ddc246
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 10:18:32 2015 +0300

    Merge branch 'master' into assert

    * master:
      Set PHP_JSON_VERSION to 1.4.0
      Remove unnecessary resource checks in openssl ext
      JSON is now maintained

commit 8473157fbb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 10:17:26 2015 +0300

    Fixed typo and white spaces

commit 96de5ffc8d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Feb 18 00:28:39 2015 +0300

    Fixed assert() in namesapaces

commit 5eba069c28
Merge: 4a2d9c0 d428bf2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Feb 17 22:45:55 2015 +0300

    Merge branch 'master' into assert

    * master: (25 commits)
      improve debugability in TS debug builds
      More UPGRADING, in particular on foreach
      Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) for master
      Replace var is introduced
      abstain from using xmlCleanupParser
      fix TS build
      Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
      update news
      Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
      Port for for bug #68552
      Fix bug #68942 (Use after free vulnerability in unserialize() with DateTimeZone)
      Update NEWS
      Fixed bug #69038 (switch(SOMECONSTANT) misbehaves)
      - BFN
      Don't read the local php.ini when Generating Phar When building phar shared, you can end up loading a previous phar.so that isn't compatible with the php cli being used to generate Phar here.
      - Fixed bug #67827 (broken detection of system crypt sha256/sha512 support)
      Delete json outdated package.xml
      made ZEND_TSRMLS_CACHE_* macros look like function calls
      - Fix merge
      - Fixed bug #67427 (SoapServer cannot handle large messages) patch by: brandt at docoloc dot de
      ...

commit 4a2d9c0953
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue Feb 17 22:45:10 2015 +0300

    Implemented AST pretty-printer to capture expression passed to assert()

commit 7a059b66d5
Merge: 9973df7 3892eba
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon Feb 16 18:42:28 2015 +0300

    Merge branch 'expect' of github.com:krakjoe/php-src into assert

    * 'expect' of github.com:krakjoe/php-src:
      import expect

    Conflicts:
    	Zend/zend_compile.c
    	Zend/zend_execute_API.c
    	Zend/zend_globals.h
    	Zend/zend_vm_def.h
    	Zend/zend_vm_execute.h
    	Zend/zend_vm_opcodes.c
    	Zend/zend_vm_opcodes.h
    	ext/opcache/Optimizer/block_pass.c
    	ext/opcache/Optimizer/pass1_5.c
    	ext/standard/assert.c
    	ext/standard/tests/assert/assert_error3.phpt

commit 3892eba2bf
Author: krakjoe <joe.watkins@live.co.uk>
Date:   Sun Feb 2 12:49:35 2014 +0000

    import expect
2015-03-02 12:25:40 +03:00
Xinchen Hui
a8927cd647 Merge branch 'PHP-5.6' 2015-02-27 11:43:49 +08:00
Xinchen Hui
cfaf7c3b5f Merge branch 'PHP-5.5' into PHP-5.6 2015-02-27 11:42:57 +08:00
Xinchen Hui
3e82816ba1 Fixed bug #69125 (Array numeric string as key) 2015-02-27 11:42:36 +08:00
Xinchen Hui
34d397e267 better name 2015-02-25 20:49:07 +08:00
Xinchen Hui
60f18026eb Merge branch 'PHP-5.6'
Conflicts:
	ext/opcache/Optimizer/zend_optimizer.c
2015-02-25 20:16:15 +08:00
Xinchen Hui
d3615b5fb1 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/opcache/tests/bug69038.phpt
2015-02-25 20:13:47 +08:00
Xinchen Hui
d508ff9640 Improve fix for #69038 2015-02-25 20:07:02 +08:00
Dmitry Stogov
c2c78dc963 Added specialized versions of DO_FCALL handler:
DO_ICALL - for internal functions
  DO_UCALL - for user functions
  DO_FCALL_BY_NAME - plain, most probably user, funcstions (not methods)
2015-02-25 10:37:21 +03:00
Dmitry Stogov
5f278e4d3a Use cache_slot offsets instead of indexes (simplify run-time instructions) 2015-02-25 01:52:35 +03:00
Dmitry Stogov
dcb96c2e03 Split INIT_FCALL_BY_NAME inti INIT_FCALL_BY_NAME(CONST+STRING) and INIT_DYNAMIC_CALL(CONST-STRING|TMPVAR|CV) 2015-02-24 22:29:47 +03:00
Xinchen Hui
2a724becc1 Unused vars 2015-02-21 11:02:20 +08:00
Dmitry Stogov
e142e31137 Fixed memory leak 2015-02-20 20:50:01 +03:00
Dmitry Stogov
623810eff4 Use fast SSE2 memcpy() for copying block of data from SHM to process memory 2015-02-20 16:08:57 +03:00
Dmitry Stogov
5100afb7dd Simplify reallocation during copying data from SHM to process memory 2015-02-20 15:38:06 +03:00
Dmitry Stogov
5f76eed14e don't count op_arrays stored in opcache SHM 2015-02-20 14:59:30 +03:00
Dmitry Stogov
04836f0e55 Removed dead code 2015-02-20 13:46:32 +03:00
Dmitry Stogov
d85113702c Lazy duplication of op_array->static_variables 2015-02-20 13:28:26 +03:00
Dmitry Stogov
582aa41d6f Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed type mismatch
2015-02-20 10:33:07 +03:00
Dmitry Stogov
90421b0d5b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed type mismatch
2015-02-20 10:32:34 +03:00
Dmitry Stogov
9fb48edf3c Fixed type mismatch 2015-02-20 10:31:24 +03:00
Xinchen Hui
7299d43536 Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) for master 2015-02-17 22:05:57 +08:00
Xinchen Hui
e22759b1e5 Replace var is introduced 2015-02-17 21:16:37 +08:00
Xinchen Hui
1c0fa36c61 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-17 11:36:15 +08:00
Xinchen Hui
66d3095993 Fixed bug #69038 (switch(SOMECONSTANT) misbehaves) 2015-02-17 11:34:57 +08:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Dmitry Stogov
97fe15db43 Fix "forech" statemt behaviour according to https://wiki.php.net/rfc/php7_foreach
Squashed commit of the following:

commit 1e41295097
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Jan 31 07:28:58 2015 +0300

    Generalize HashTableIterator API to allows its usage without involvement of HashTable.nInternalPonter

commit 5406f21b11
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:43 2015 +0300

    Reduced alghorithms complexity

commit b37f1d58d2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:30 2015 +0300

    Fixed test name

commit fb2d079645
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:05 2015 +0300

    API cleanup

commit 08302c0d6d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 14:20:46 2015 +0300

    Make array_splice() to preserve foreach hash position

commit cc4b7be41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 12:24:31 2015 +0300

    Make internal function, operation on array passed by reference, to preserve foreach hash position

commit 5aa9712b0a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 09:49:35 2015 +0300

    Implement consistent behavior for foreach by value over plain object

commit 4c5b385ff5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 07:56:37 2015 +0300

    More careful iterators update.

commit 721fc9e80d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:43:28 2015 +0300

    Added new test

commit 15a23b1218
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:05:02 2015 +0300

    Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details)

commit 10a3260b1f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:04:44 2015 +0300

    New test

commit eef80c5837
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 16:52:21 2015 +0300

    Fixed foreach by reference iteration over constant array

commit 61e7391873
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 14:59:54 2015 +0300

    Fixed temporary variable re-allocation pass

commit 92e90c09f0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 12:44:57 2015 +0300

    Fixed operand destruction in case of exceptions in iterator

commit dd2a36a207
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 10:02:34 2015 +0300

    Use GET_OP1_ZVAL_PTR_DEREF() (IS_TMP_VAR and IS_CONST can't be IS_REFERENCE)

commit 4638f7b914
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 07:43:28 2015 +0300

    Change "foreach" statement behavior (this is just a PoC yet)

    - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy.

    - it makes no difference if array given to "foreach by value" is reference itself

    - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented)
2015-02-12 13:57:12 +03:00
Dmitry Stogov
9d5d736869 Avoid repeatable calls to strstr() 2015-02-09 22:42:37 +03:00
Bob Weinand
fc444fbc70 Shut up, my lovely compiler; I do not like your warnings
Conflicts:
	Zend/zend_object_handlers.c
2015-02-09 11:23:35 +08:00
Xinchen Hui
e82e22e27b Opcache is enable by default 2015-02-05 17:07:30 +08:00
Xinchen Hui
a071fc4604 Added CREDITS 2015-02-05 16:58:19 +08:00
Stanislav Malyshev
dd15207dc5 Merge branch 'pull-request/945'
* pull-request/945:
  Update zend_accelerator_hash.c
  hashmap sizes
  Wasted Shared Memory aboce 2Gb fix
2015-01-31 23:10:37 -08:00
Xinchen Hui
a1d9ceac7a Fixed annoying warnings 2015-01-29 11:59:37 +08:00
Xinchen Hui
659395e3dd Merge branch 'master' of https://git.php.net/repository/php-src 2015-01-29 00:01:24 +08:00
Levi Morrison
c8576c5a46 Implement return types
RFC is documented here: https://wiki.php.net/rfc/return_types
2015-01-27 11:49:56 -07:00
Xinchen Hui
1828ec21e2 Fixed some annoying warnings 2015-01-27 23:28:31 +08:00
Anatol Belski
d0e75bdc59 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #68827 Double free with disabled ZMM
  Fixed segfault while running with moodle
2015-01-22 10:00:10 +01:00
Xinchen Hui
201f660ae1 Merge branch 'PHP-5.6' 2015-01-22 16:39:22 +08:00
Xinchen Hui
d0928b7f97 Merge branch 'PHP-5.5' into PHP-5.6 2015-01-22 16:39:03 +08:00
Xinchen Hui
251745c012 Fixed segfault while running with moodle 2015-01-22 16:38:34 +08:00
Xinchen Hui
88e88426df Merge branch 'PHP-5.6' 2015-01-21 11:18:27 +08:00
Xinchen Hui
57ff5a4e6f Merge branch 'PHP-5.5' into PHP-5.6 2015-01-21 11:18:08 +08:00
Xinchen Hui
20e5911d82 Fixed test fails 2015-01-21 11:17:49 +08:00
Dmitry Stogov
22ac15e6c9 Improve optimization of CONCAT/ADD_STRING/ADD_CJAR sequences 2015-01-19 17:01:30 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Dmitry Stogov
2387771daf Slight improvement in copying script from opcache SHM into process memory 2015-01-12 23:51:40 +03:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Xinchen Hui
aa5b3b0e4a Merge branch 'PHP-5.6' 2015-01-09 11:54:01 +08:00
Xinchen Hui
0547edb5c2 Fixed bug (try block removed while combined with xdebug) 2015-01-09 11:53:47 +08:00
Xinchen Hui
777c39f404 Fixed #68677 2015-01-08 16:32:20 +08:00
Dmitry Stogov
37466b0368 Use special flag (HASH_FLAG_INITIALIZED) instead of (nTableMask == 0) to indicate that HashTable is allocated.
Make nTableMask to be 0 for packed arrays.
Remove checks fo HASH_FLAG_PACKED in zend_hash_find/zend_hash_del and family (string keys are resolved through uninitialized_bucket).
Change HashTable layout for better locality.
2014-12-27 11:07:12 +03:00
Dmitry Stogov
814df43fb9 Reimplemented used stack size recalculation (replaced 3d4babdc2b) 2014-12-26 12:42:38 +03:00
Xinchen Hui
3d4babdc2b Adjust tempoary variable used in caller's side 2014-12-25 14:57:58 +08:00
Xinchen Hui
e0ca75a454 No need to do this check for master, ZEND_COMPILE_NO_BUILTIN_STRLEN already cover it 2014-12-24 20:42:17 +08: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
Xinchen Hui
d4f89fbda4 Merge branch 'PHP-5.6'
Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2014-12-24 18:30:06 +08:00
Xinchen Hui
bba4a8aad5 Fixed bug #68644 (strlen incorrect : mbstring + func_overload=2 +UTF-8 + Opcache) 2014-12-24 17:55:58 +08:00
Dmitry Stogov
2646f7bcb9 Don't count variadic argument in zend_func.common.num_args. This allows faster CALL/RETURN code. 2014-12-22 16:44:39 +03:00
Xinchen Hui
b5b617674e Micro optimaztion (yeah, I know compiler supposed to do that) 2014-12-22 00:10:46 -05:00
Adrian
bdb2d49071 Update zend_accelerator_hash.c 2014-12-21 15:22:49 +01:00
Nikita Popov
c94f62d0d9 Merge branch 'PHP-5.6'
Conflicts:
	ext/opcache/Optimizer/pass2.c
2014-12-19 21:51:05 +01:00
Nikita Popov
87ccf50bad Merge branch 'PHP-5.5' into PHP-5.6 2014-12-19 21:46:38 +01:00
Nikita Popov
aa394e70ff Fix bug #67111
Loop variables need to be freed for both "break" and "continue".

I'm adding the test to Zend/ because it's good to have a test for
this even without opcache.
2014-12-19 21:42:42 +01: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
e8acb9ff26 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  fix integral constant overflow warning
  Use HUGE PAGES for opcahce SHM, if available.
2014-12-17 17:46:48 +01:00
Dmitry Stogov
12ce17c47e Use HUGE PAGES for opcahce SHM, if available. 2014-12-17 14:59:08 +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
Anatol Belski
dfb18b1188 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  updated NEWS
  PowerPC64 support for add and sub with overflow check
  PowerPC64 support for operators with overflow check
  Fixed bug #68583 Crash in timeout thread
  Reduced size of zend_op on 64-bit systems.
  Make ZEND_INIT_FCALL keep predcalculted size of necessary stack space in opline->op1.num to avoid its recalculation on each execution.
  Removed unused variables
  Improved array_merge() and array_replace() (1-st array may be added using simple procedure).
  Replaced zendi_convert_to_long() with _zval_get_long_func()
  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().
  Revert "Save one xor instr"
  Save one xor instr

Conflicts:
	Zend/zend_execute_API.c
2014-12-12 14:25:59 +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
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
Adrian
3141922321 hashmap sizes 2014-12-08 13:54:12 +01:00
Adrian
9995452583 Wasted Shared Memory aboce 2Gb fix 2014-12-08 13:14:15 +01:00
Anatol Belski
88bb9fedc4 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (111 commits)
  Fix zend_fcall_info_arg*() to use ZVAL_COPY
  Fixed #65213 - cannot cast SplFileInfo to boolean
  add initial install
  switch to C travis project instead of PHP
  use the generic TRAVIS environment var to check for travis (see http://docs.travis-ci.com/user/ci-environment/)
  fix TS build
  add config option to target codegen architectures
  updated NEWS
  updated NEWS
  Fixed bug #55541 errors spawn MessageBox, which blocks test automation
  Get rid of duplicate handlers (ZEND_ADD_SPEC_TMP_TMP and ZEND_ADD_SPEC_VAR_VAR are absolutely the same).
  Use zend_string* for op_array->arg_info[]->name and op_array->arg_info[]->class_name. For internal functions we still use char*.
  Fixed __debugInfo() support
  Update UPGRADING for the new variadic functions, and re-sort.
  Improved POST INC/DEC
  make sure that we don't truncate the stack trace and cause false test failures when the test is executed in a directory with long path
  Missed closed folder mark
  Revert "Unecessary assignment"
  Fixed improper memory release
  Unecessary assignment
  ...
2014-12-05 03:50:02 +01: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
cd68c4b1d2 Fixed __debugInfo() support 2014-12-03 12:13:01 +03:00
Dmitry Stogov
dcfe58773e Rename EX_VAR_2() into ZEND_CALL_VAR() and EX_VAR_NUM_2() into ZEND_CALL_VAR_NUM(). 2014-11-28 11:11:33 +03:00
Anatol Belski
864cd82ace Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  updated NEWS
  refactored the mbstring config.w32
  Update NEWS
  Fixed compilation warnings
  Fixed bug #68504 --with-libmbfl configure option not present on Windows
  Changed "finally" handling. Removed EX(fast_ret) and EX(delayed_exception). Allocate and use additional IS_TMP_VAR slot on VM stack instead.
  the darwin specific test fails for me with the same output which is the expected for the original test I couldn't find anybody who managed to see this test passing, but I found a bunch of other reports on qa.php.net/reports and on google which do see this test failing on mac. if this change causes you to have this test failing on Mac, please drop me a mail so we can improve the current test so it passes for everybody.
  #68446 is fixed
  Reimplemented silence operator (@) handling on exceptions. Now each silence region is stored in op_array->brk_cont_array. On exception ZEND_HANDLE_EXCEPTION handler traverse this array and restore original EG(error_reporting) if exception occured inside a "silence" region.
  remove the NEWS entries for the reverted stuff
  typo fix
  go back with phpdbg to the state of 5.6.3, reverting the controversial commits(remote debugging/xml protocol)
  5.5.21 now
  New label length test
  Fix ext/filter/tests/033.phpt
  Fix filter_list test
  FILTER_VALIDATE_DOMAIN and RFC conformance for FILTER_VALIDATE_URL

Conflicts:
	ext/mbstring/config.w32
2014-11-27 15:59:43 +01:00
Dmitry Stogov
303d73ecd2 Reimplemented silence operator (@) handling on exceptions. Now each silence region is stored in op_array->brk_cont_array. On exception ZEND_HANDLE_EXCEPTION handler traverse this array and restore original EG(error_reporting) if exception occured inside a "silence" region. 2014-11-26 22:44:58 +03:00
Anatol Belski
3ca0ca1548 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (102 commits)
  fix dir separator in test
  fix TS build
  fix TS build
  Better fix for bug #68446
  Revert "Merge remote-tracking branch 'origin/PHP-5.6'"
  Revert NEWS and set test to XFAIL
  Revert "Fix bug #68446 (bug with constant defaults and type hints)"
  Improved zend_hash_clean() and added new optimized zend_symtable_clean()
  Use inline version of zval_ptr_dtor()
  Added new optimized zend_array_destroy() function
  Moved i_zval_ptr_dtor() from zend_execute.h to zend_variables.h
  fix REGISTER_NS_*_CONSTANT macros
  Removed useless assert. EG(uninitialized_zval) can't be refcounted.
  Use specialized destructors when types of zvals are known.
  move tests into proper place
  Improved assignment to object property
  Reuse zend_assign_to_variable() in zend_std_write_property()
  cleanup comments from svn/cvs era
  fix dir separator in test
  fork test for windows
  ...
2014-11-26 08:17:35 +01:00
Stanislav Malyshev
759f03ac84 Merge branch 'pull-request/819'
* pull-request/819:
  Indention fix
2014-11-23 17:11:54 -08:00
Anatol Belski
4f3ac2cdbe Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (36 commits)
  NEWS
  adapt test for error message introduce in fix for #68463
  Fix bug #68463 listen.allowed_clients can silently result in no allowed access
  run a few request in this test
  fix test
  fix test
  added info about some other macro changes
  added note about toolset and phpize
  added note about the response files
  split msgfmt_format_intlcalendar_variant*.phpt for ICU 54.1
  split formatter_format*.phpt for ICP 54.1
  split dateformat_timezone_arg_variations*.phpt for ICU 54.1
  split dateformat_get_set_timezone_variant*.phpt for ICU 54.1
  fix icu version to test
  split ext/intl/tests/dateformat_get_set_calendar_variant*.phpt for 54.1
  split dateformat_formatObject_datetime_variant*.phpt for ICU 54.1
  split dateformat_formatObject_calendar_variant*.phpt for ICU 54.1
  split dateformat_create_cal_arg_variant2.phpt for ICU 53.1 and 54.1
  clone dateformat_calendars_variant3.phpt for ICU 54.1
  split collator_get_sort_key_variant3.phpt for icu 54.1
  ...
2014-11-20 15:20:18 +01:00
Veres Lajos
4b9535341a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-19 20:23:00 +00:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Dmitry Stogov
e20a727430 SEND_VAR_NO_REF optimization 2014-11-18 14:37:36 +03:00
Dmitry Stogov
2afb5df4da Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix opcache.revalidate_freq per-request behavior

Conflicts:
	ext/opcache/ZendAccelerator.h
2014-11-07 10:24:25 +03:00
Dmitry Stogov
e6581d52cc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix opcache.revalidate_freq per-request behavior
2014-11-07 10:17:48 +03:00
Dmitry Stogov
033abd6d77 Fix opcache.revalidate_freq per-request behavior 2014-11-07 10:16:25 +03:00
Xinchen Hui
241d73cbf9 Merge branch 'PHP-5.6' 2014-11-01 22:30:22 +08:00
Xinchen Hui
00b50850eb Add credit 2014-11-01 22:29:55 +08:00
Xinchen Hui
ccb09eb352 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_API.c
2014-10-31 17:37:56 +08:00
Xinchen Hui
d017c4bf3a Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6 2014-10-31 17:36:33 +08:00
Xinchen Hui
d9d181e5ad Fixed Bug #68104 (Segfault while pre-evaluating a disabled function) 2014-10-31 17:32:23 +08:00
Dmitry Stogov
10107db61e Use DECLARE_CONST instruction instead of call to internal define() function when possible 2014-10-30 16:42:39 -07:00
Dmitry Stogov
1551db8faa Added constant expression evaluation for "dirname(__FILE__)".
Improved constant expression evaluation for function calls
2014-10-30 15:15:51 -07:00
Xinchen Hui
e6fe3127d0 Fixed bug #68252 (segfault in Zend/zend_hash.c in function _zend_hash_del_el)
Don't leave a UNDEF gap in function_table
2014-10-28 17:36:03 +08:00
Rasmus Lerdorf
c8e1fae17f Fix off-by-one here 2014-10-26 16:59:17 -07:00
Anatol Belski
c51a42076c Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (214 commits)
  fix datatype mismatch warnings
  fix datatype mismatches
  fix datatype mismatches
  fix datatype mismatches
  fix datatype mismatch warnings
  fix datatype mismatch warnings
  fix datatype mismatch warnings
  fix datatype mismatch warning
  fix datatype mismatches
  fix datatype mismatch warnings
  Re-add phpdbg to travis
  Added some NEWS
  Make xml valid (missing space between attrs)
  Fix info classes file name in xml
  Add note about <eval> tag for errors in xml.md
  Name the tag <eval> if the error id during ev cmd
  Do not print out xml as PHP print...
  Fix output to wrong function
  Fixed parameter order on %.*s
  Too much copypaste...
  ...
2014-10-24 22:28:32 +02:00
Dmitry Stogov
4fd435abab Embed FETCH_CLASS <string> into the following NEW 2014-10-23 11:52:34 +04:00
Dmitry Stogov
62e3998dae Removed useless code 2014-10-22 22:32:06 +04:00
Dmitry Stogov
534d854fb2 Embed FETCH_CLASS <string> into the following INSTANCEOF 2014-10-22 17:23:43 +04:00
Dmitry Stogov
ab539e177e Removed old irrelevant comment 2014-10-20 13:52:28 +04:00
Anatol Belski
4fce2ae2c6 opcache, intl, gmp, exif, com, bcmath to use static tsrmls 2014-10-17 15:51:21 +02:00
Anatol Belski
c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski
19c41e1f53 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST.
  Ensure __LINE__ is always accurate
  Fix incdec of referenced properties
  Fix ::jsonSerialize() failure message
  Fix invalid zend_string_frees in reflection
  Remove retval member in spl_dllist
  DLL export several APIs needed for phpdbg
  More fixes for nodelist array access - testing for null property read - no zval copying if the type is already long - memory fix for master
2014-10-13 13:52:31 +02:00
Dmitry Stogov
702a2dfb3e Merge branch 'PHP-5.6'
* PHP-5.6:
  We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST.

Conflicts:
	ext/opcache/Optimizer/pass1_5.c
2014-10-13 14:10:44 +04:00
Dmitry Stogov
7acba332fe We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST. 2014-10-13 14:07:37 +04:00
Anatol Belski
e1cd0e0a38 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (40 commits)
  int to size_t where the underlaying API supports it
  use php_socket_t instead of int
  fix signed/unsigned mismatch warning
  fix compilation warning
  Improved specialisation $this variable accessed through IS_UNUSED operand must be IS_OBJECT, so we don't have to check for its type or perform dereference.
  Add notes about get_class_entry/get_class_name to UPGRADING
  Fix casts in GD
  Drop redundant casting code from ext/filter
  update NEWS
  update NEWS
  update NEWS
  update NEWS
  Added note to UPGRADING regarding 64-bit support in pack()/unpack()
  pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG
  Add 64 bit formats to pack() and unpack()
  Help to CPU branch predictor
  Removed unused EG(orig_error_reporting)
  Update get_class_name semantics
  Remove Z_OBJ_CLASS_NAME_P
  Improved VM stack primitives for fast paths. Slow paths are not inlined anymore.
  ...
2014-10-10 22:51:13 +02:00
Dmitry Stogov
9b0b30272f Copy all the arena allocated data from SHM to process memory at once 2014-10-09 14:01:19 +04:00
Anatol Belski
a91d3580a7 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  properly export tsrm_strtok_r()
  Fixed list() behavior inconsistency (string handling is disabled for all cases, ArrayAccess objects handling is enabled for all cases, ZEND_FETCH_DIM_TMP_VAR opcode is renamed into ZEND_FETCH_LIST, ZEND_FETCH_ADD_LOCK flag is removed).
  Fix accidental edit in previous commit
  Fix arginfo
  DateTimeZone::getOffset() now accepts a DateTimeInterface
  DateTimeZone::getOffset() now accepts a DateTimeInterface
  Moved checks and error reporting related to static methods from DO_FCALL inti INTI_FCALL* opcodes that may really deal with static methods. (In some rare cases it may lead to different order of warning messages).
  Fixed a bug that causes crash when environment variable is access while parsing php.ini
  Fixed a bug that causes crash when environment variable is access while parsing php.ini
2014-10-05 19:26:17 +02:00
Dmitry Stogov
7c7b9184b1 Fixed list() behavior inconsistency (string handling is disabled for all cases, ArrayAccess objects handling is enabled for all cases, ZEND_FETCH_DIM_TMP_VAR opcode is renamed into ZEND_FETCH_LIST, ZEND_FETCH_ADD_LOCK flag is removed). 2014-10-05 13:02:58 +04:00
Anatol Belski
d624b0d5eb Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (26 commits)
  Micro optimization
  Drop unused INIT_STRING opcode
  Drop unused RAISE_ABSTRACT_ERROR opcode
  CT substitute unqualified true/false/null in namespaces
  Fix a couple compile warnings
  fix test filename
  one more test to illustrate transfer of an arbitrary data amount throug pipes
  fix tests on linux
  better test cleanup
  Use more readable inline functions
  increase the polling period to not to break existing behaviours
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever
  Fixed segfault
  Set an LDAP error code when failing ldap_bind due to null bytes
  Fix segmentation fault in debug_backtrace()
  Drop support for GMP 4.1
  Make gmp_setbit and gmp_clrbit return values consistent
  removed *.dsw and *.dsp files
  Opcache compatibility for coalesce operator
  ...
2014-10-01 01:33:46 +02:00
Nikita Popov
67a11b61cd Drop unused INIT_STRING opcode
INIT_STRING has been implemented as an UNUSED op1 to ADD_* for
some time now.
2014-09-29 22:59:57 +02:00
Nikita Popov
5bd34be604 Opcache compatibility for coalesce operator 2014-09-28 12:31:52 +02:00