Commit graph

831 commits

Author SHA1 Message Date
Dmitry Stogov
ccc12b82da Avoid unnecessary reference-counting on strings. 2017-11-16 17:09:32 +03:00
Xinchen Hui
a8a17a72b0 RC manipulation cleanup 2017-11-01 10:25:10 +08:00
Sara Golemon
bbf57b114f
Revert array_slice passthrough optimization
This reverts commit fabb5b7a74.
This reverts commit e751e6ceba.
2017-10-30 11:08:28 -04:00
Dmitry Stogov
fad75a54d4 Merge branch 'master' into rc_debug
* master: (26 commits)
  Better fix for bug #75451 (Assertion fails while foreach on empty xpath query)
  Catch with the latest AppVeyor unzip errors
  Fixed type inference
  Fix bug #75453 Incorrect reflection on ibase_connect and ibase_pconnect
  Fix compiler warnings
  We don't use a specific model for a MAKERNOTE so remove these checks that doesn't do anything anyway
  Remove these old comments, as for the TODO, there is already a FR for this
  Re-enable AppVeyor cache
  make sure run-tests reports exit status upon prerequisite error
  Remove implicit constants from test case
  Fix invalid read in zend_use_undefined_constant()
  Fix invalid read in mb_ord()
  Remove --with-libmbfl configure option
  Fixed bug #75451 (Assertion fails while foreach on empty xpath query)
  Add tests for UConverter::getStandards()
  convert spaces to tabs in ext/ftp/tests/server.inc
  Add tests for ftp_rename
  Fix bug #75434 Wrong reflection for mysqli_fetch_all function
  Don't optimize input arrays with suffix holes
  Fix bug #75307 Wrong reflection for openssl_open function
  ...
2017-10-30 12:11:35 +03:00
Sara Golemon
352b406650 Merge branch 'PHP-7.2'
* PHP-7.2:
  Don't optimize input arrays with suffix holes
2017-10-27 13:07:50 -04:00
Sara Golemon
cc96166f74
Don't optimize input arrays with suffix holes 2017-10-27 13:07:33 -04:00
Sara Golemon
fabb5b7a74
array_slice() passthrough for preserve_keys=true as well 2017-10-27 10:14:03 -04:00
Sara Golemon
e751e6ceba
Do not create a new array when slicing all of input array. 2017-10-27 10:09:05 -04:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Anatol Belski
793ca716fb Fix datatypes and compiler warnings
Switch to size_t

Not critical as an unsigned is already used, but fixes a couple of
warnings in other areas.

Normalize signature

It's a function with the usual compare semantics, returning a platform
specific at least produces unnecessary warnings elsewhere and is otherwise
inappropriate.

Fix return value

Drop unused var

Fix compiler warnings

Fix compiler warning

Fix var name in arginfo

Fix cast
2017-10-23 08:56:57 +02:00
Dmitry Stogov
254b74b85f HASH_FLAG_PERSISTENT renamed into IS_ARRAY_PERSISTENT and moved into GC_FLAGS (to be consistent with IS_STR_PERSISTENT). 2017-10-06 02:54:14 +03:00
Dmitry Stogov
cb9d81ef4f Refactored recursion pretection 2017-10-06 01:34:50 +03:00
tbpgr
ba83338cbe Fix typo retuns to returns 2017-08-25 01:30:14 +09:00
Kalle Sommer Nielsen
4fbff82c10 Kill compiler warnings in ext/standard 2017-08-24 01:36:14 +02:00
Nikita Popov
6c2c7a023d Optimize array_unique()
In SORT_STRING mode, instead of sorting the array, build a hash of
seen elements.
2017-08-01 18:08:38 +02:00
Dmitry Stogov
5a51da9942 Use inlined version of zval_ptr_dtor() in array_map() loop 2017-06-29 12:15:57 +03:00
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Dmitry Stogov
9c2a1f52a5 Avoid useless dereferences and separations during paramter passing. 2017-06-19 12:55:59 +03:00
Dmitry Stogov
ace9fe5317 Improved new Zend Parameter Parsing API to avoid useless dereferences.
This derefernce made sense only for explicit paramter passing by reference, but this feature was removed in PHP-7.
The improvement is 100% backward compatible, only few "tricky" functions may be affected (e.g. extract and usort).
2017-06-08 13:03:24 +03:00
Dmitry Stogov
27e7aea412 "Countable" interface is moved from SPL to Core 2017-05-25 12:47:43 +03:00
Dmitry Stogov
a08723d3d3 Use interned empty and "one char" strings. 2017-05-18 17:59:59 +03:00
Dmitry Stogov
2649a9e1a9 Removed useless dereferences 2017-05-17 21:01:08 +03:00
Nikita Popov
51b06aa86e Merge branch 'PHP-7.1' 2017-04-02 13:20:14 +02:00
Nikita Popov
c8034514ed Fixed bug #74361 2017-04-02 13:19:32 +02:00
Thomas Punt
932c4b35dc Remove more unnecessary checks on Zend's allocator functions 2017-03-16 12:23:55 +01:00
Sara Golemon
131fd3baa0 Remove unnecesary shadow of new_val 2017-03-14 11:29:22 -07:00
Sara Golemon
c74bc87c74 Minor optimizations to array_keys()/array_values()
array_values():
When the input is an empty array or a packed array with no gaps,
return the original array.

array_keys():
When the input is an empty array, return the original array.
When the input is a packed array with no holes
(and no search key specified), populate the return with
a simple range(0, count($input) - 1)
2017-03-14 11:23:02 -07:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Levi Morrison
b7552ff344 Remove trailing tabs 2017-01-21 10:11:23 -07:00
Dmitry Stogov
1f7bf2bfd6 Optimized extract(). Avoided double hash lookups and repeatable checks through loop splitting. 2017-01-20 10:39:27 +03:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Sara Golemon
1b0edb3c6c Use new param API in standard/array 2016-12-30 10:35:45 -08:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Craig Duncan
aaf7341b1c Add warnings when counting invalid parameters 2016-11-17 09:33:04 +00:00
Nikita Popov
23772d5b70 Merge branch 'PHP-7.1' 2016-10-20 13:26:51 +02:00
Nikita Popov
736633310c Merge branch 'PHP-7.0' into PHP-7.1 2016-10-20 13:26:34 +02:00
Adam Saponara
55d17662cb Fix bug #71241: array_replace_recursive mutates ref params
`array_replace_recursive` can sometimes mutate its params if
references are nested within. This differs from the PHP 5 behavior.
2016-10-20 13:22:04 +02:00
Dmitry Stogov
65ea250022 Merge branch 'PHP-7.1'
* PHP-7.1:
  Introduced HT_IS_PACKED() and HT_IS_WITHOUT_HOLES() macros. (Benjamin Coutu)
2016-10-19 23:12:17 +03:00
Dmitry Stogov
9ded1b4edb Introduced HT_IS_PACKED() and HT_IS_WITHOUT_HOLES() macros. (Benjamin Coutu) 2016-10-19 23:10:42 +03:00
Andrea Faulds
695176458f Merge branch 'PHP-7.1' 2016-09-11 22:46:48 +01:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Nikita Popov
e0e5063173 Drop some pieces of commented-out code 2016-09-04 12:56:06 +02:00
Anatol Belski
1d64b4c71e avoid needless function call 2016-09-01 23:45:31 +02:00
Márcio Almada
00c2c3a476 fix unintentional bc break with compact('this') behavior 2016-09-01 13:01:38 +02:00
Kalle Sommer Nielsen
447e57a1e1 Fixed 7.1 build, decls first please! 2016-08-17 20:26:32 +02:00
Kalle Sommer Nielsen
1e4cae28b2 Seems like I did a bad merge earlier, this should make PHP-7.0 sync with 7.1/master properly now 2016-08-17 16:34:22 +02:00
Kalle Sommer Nielsen
27ceb6ffb5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix build as done in master in commit 040331c364
  Fixed C89 build
2016-08-17 14:15:09 +02:00