Dmitry Stogov
2d8f238318
Avoid duplication
2017-12-07 14:59:42 +03:00
Dmitry Stogov
fd453aa1d1
Intern string constant values
2017-12-07 12:27:16 +03:00
Dmitry Stogov
3f6b46f331
typo
2017-12-07 12:26:48 +03:00
Dmitry Stogov
2ded0d2c0e
Avoid unnecessary duplication
2017-12-07 12:00:41 +03:00
Dmitry Stogov
7803459242
Wrap functions necessary only for ZTS build with #ifdef
2017-12-07 11:59:58 +03:00
Dmitry Stogov
91507ba6e8
Reduced VM code size.
...
Made FETCH_DIM/OBJ_FUNC_ARG to dispatch ro corresponding FETCH_DIM/OBJ_R/_W handlers.
Merged TMP and VAR specializations of ZEND_FETCH_OBJ_R.
Allowed dispatching to less specialized handelrs and helpers. (e.g. from OP_TMP_CONST to OP_TMPVAR_CONST).
2017-12-07 01:52:27 +03:00
Nikita Popov
4e6b80ca54
Fix movzb operand size
2017-12-06 23:15:35 +01:00
Dmitry Stogov
1646042342
Use local labels
2017-12-06 17:47:30 +03:00
Dmitry Stogov
3beaf10289
Fixed gcc assembler constaints.
...
Added less efecient replacement functions for valgrind, to prevent warnings about uninitialized tail.
2017-12-06 15:32:31 +03:00
Dmitry Stogov
d1d1aff4e5
Optimization of init_func_execute_data()
2017-12-06 02:53:30 +03:00
Dmitry Stogov
7a136cd3dd
Removed useless LOAD_OPLINE()
2017-12-05 17:40:39 +03:00
Dmitry Stogov
c019c131e8
Use unsigned comparison instructions
2017-12-05 02:41:12 +03:00
Dmitry Stogov
8305a73483
Implemented x86 and x86_64 assembler functions for zend_string equality check.
...
They take into account zend_string layout (value alignment and trailing padding) and perform comparison by double or quad words.
2017-12-04 23:40:54 +03:00
Nuno Lopes
f55083906f
fix build with older gccs: label attributes are only available with gcc 5+
2017-12-04 15:12:20 -05:00
Dmitry Stogov
74c84cd7f0
Use zend_string_equal*() API for zend_string equality check instead of direct memcmp() usage.
2017-12-04 17:17:02 +03:00
Dmitry Stogov
cc12acefcd
Use cheaper functions
2017-12-04 13:21:35 +03:00
Nikita Popov
cbe60003f1
Merge branch 'PHP-7.0' into PHP-7.1
2017-12-02 18:11:03 +01:00
Andy Postnikov
d6d4f2a9b3
Fix ZEND_SIGNED_MULTIPLY_LONG for AArch64
...
Register operands are required in this context.
This is a backport of 8c8679207a
to PHP 7.0+. The current code caused incorrect behavior on AArch64
when compiling with clang.
2017-12-02 18:10:17 +01:00
Dmitry Stogov
92cc7f9fab
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Set trailing zero
2017-12-01 17:01:10 +03:00
Dmitry Stogov
01b85f0e17
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Set trailing zero
2017-12-01 17:00:51 +03:00
Dmitry Stogov
b73151845f
Merge branch 'PHP-7.0' into PHP-7.1
...
* PHP-7.0:
Set trailing zero
2017-12-01 17:00:42 +03:00
Dmitry Stogov
24d5adbd5a
Set trailing zero
2017-12-01 17:00:11 +03:00
Dmitry Stogov
7cc6f60134
Added "argv" and "argc" as known strings.
...
Fixed incorrect "argc" update and corresponding phpdbg test.
2017-12-01 01:35:47 +03:00
Anatol Belski
821bdbdfba
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Revert "Fix macro redefinition warnings"
2017-11-30 13:23:18 +01:00
Anatol Belski
b6a27c7332
Revert "Fix macro redefinition warnings"
...
This reverts commit 23d2bd3748
.
2017-11-30 13:21:04 +01:00
Anatol Belski
a415006b5e
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Fix macro redefinition warnings
2017-11-30 12:41:44 +01:00
Anatol Belski
23d2bd3748
Fix macro redefinition warnings
...
The corresponding implementations are available from APR.
2017-11-30 12:40:52 +01:00
Dmitry Stogov
134248164c
Only functions of temporary modules have to be unregistered here
2017-11-30 11:40:52 +03:00
Dmitry Stogov
3f86f43e51
Intern persistent constant names in first place
2017-11-30 01:15:11 +03:00
Dmitry Stogov
084c17fe0b
Use zend_string_tolower() where it's possible (to avoid reallocations).
...
Allow zend_string_tolower_ex() to create parsistent strings
2017-11-30 01:13:39 +03:00
Dmitry Stogov
f98721b4e0
Intern auto global name strings in first place
2017-11-29 17:10:51 +03:00
Xinchen Hui
60c742979d
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Update NEWS
Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
Revert "ext/sodium: pwhash: do not warn on low parameters"
Conflicts:
Zend/zend_object_handlers.c
2017-11-29 14:54:05 +08:00
Xinchen Hui
bedf6093ad
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
2017-11-29 14:46:44 +08:00
Xinchen Hui
3b9ba7b6bd
Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
2017-11-29 14:46:21 +08:00
Nikita Popov
5dc6392d25
Fixed bug #75575
...
These functions are never called with needle longer than haystack,
but it makes sense to explicitly check for this, especially as we
already perform a check for empty haystack anyway, which is
naturally subsumed by a haystack_len < needle_len check.
2017-11-28 23:10:50 +01:00
David Carlier
4e0b3c0c4c
Add configure check for asm goto support
...
asm goto is not supported by couple of systems. To make sure it does,
we can check it at configure-time.
2017-11-28 22:55:41 +01:00
Dmitry Stogov
6a2738c713
CONCAT/FAST_CONCAT micro-optimization
2017-11-28 14:11:40 +03:00
Dmitry Stogov
6acfade8a1
Prefer "GNU asm goto" to __builtin_saddl_overflow() for overflow detection. This allows generation of significantly better code.
2017-11-28 12:37:00 +03:00
Remi Collet
391d889f2c
drop -dev from Zend version
2017-11-28 08:01:41 +01:00
Nikita Popov
721f2cc513
Subtract one zval from memset
2017-11-25 18:02:01 +01:00
Nikita Popov
b72b1a4e4d
Add zend_object_alloc() API
...
Using ecalloc() to create objects is expensive, because the
dynamic-size memset() is unreasonably slow. Make sure we only
zero the main object structure with known size, as the properties
are intialized separately anyway.
Technically we do not need to zero the embedded zend_object
structure either, but as long as the memset argument is constant,
a couple more bytes don't really matter.
2017-11-25 17:12:37 +01:00
Nikita Popov
8795893f4f
Make sure string property/class const values are interned
...
This was done for user-definde class constant values, however this
is also important for properties and internal classes.
2017-11-25 17:12:37 +01:00
Nikita Popov
828d8e635b
Fix ZEND_VM_SPEC=0 build
2017-11-24 23:06:01 +01:00
Nikita Popov
6b258197e8
Fix zend_fetch_dimension_const()
...
Pass IS_TMP_VAR instead of IS_CONST as operand type, as IS_CONST
requires additional guarantees that are not necessarily
satisfied by the caller.
2017-11-24 21:24:13 +01:00
Dmitry Stogov
ec2dde0c0b
Introduced zend_hash_find_ex() that may avoid unnecessary hash value check.
2017-11-24 14:01:19 +03:00
Dmitry Stogov
ed7f396721
Avoid second hash value check
2017-11-24 12:03:59 +03:00
Dmitry Stogov
33b094479b
TYPE_CHECK instruction changed. Now it keeps in extended_value a type mask.
...
This makes check for "boolean" cheaper and allows check combination e.g. (is_string($a) || is_null($a))
2017-11-23 15:58:34 +03:00
Dmitry Stogov
d5dd27987f
Don't mix TYPE and TYPE_INFO
2017-11-23 13:45:21 +03:00
Dmitry Stogov
8349268fa0
Delayed unlikely checks for uninitialized variables
2017-11-23 13:18:52 +03:00
Dmitry Stogov
6780c74619
Allowed modification of VM stack page size. Exported few functions. Green light for Fibers/Coroutines.
2017-11-22 15:36:09 +03:00
Pedro Magalhães
179ed6e43d
63911: Compare opcodes of the op_array to determine different functions
2017-11-22 05:35:24 +00:00
Anatol Belski
12b2c2f5f9
Switch to ZMM routines, closes #2917
2017-11-21 19:38:53 +01:00
Dmitry Stogov
efa4d8d3ac
Optimized zend_is_true() for objects (in most cases, it doesn't need to call the conversion handler).
2017-11-20 12:38:31 +03:00
Alessandro Chitolina
23b61f78a6
Fix segfault in token_get_all_variation19.phpt
2017-11-19 00:48:48 +01:00
Anatol Belski
80d6eb6806
Fix unsigned comparisons and remove dead code
...
Fix unsigned comparison
Cleanup never executed block
Fix unsigned comparison
Fix unsigned comparison, diff can't be < 0
Fix unsigned comparison
Fix unsigned comparison
Remove dead code
2017-11-17 22:38:44 +01:00
Anatol Belski
24356e307c
Fix condition
2017-11-17 18:19:32 +01:00
Dmitry Stogov
aa7bf41502
Use cheaper checks
2017-11-17 13:23:22 +03:00
Nikita Popov
9fbb019848
Move adjust_for_fetch_type directly after emission
...
And drop the distinction between compile_X and compile_X_common.
This avoids WTF moments like compile_simple_var_no_cv completely
ignoring the BP_VAR type passed to it...
2017-11-16 22:28:29 +01:00
Nikita Popov
d9da166649
Minor fetch type adjustment cleanup
...
No need to call adjust_fetch_type on FETCH_THIS, just to special
case it in adjust_fetch_type...
2017-11-16 22:13:07 +01:00
Nikita Popov
26f8fc833b
Enable and fix printf() format warnings
...
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Dmitry Stogov
ccc12b82da
Avoid unnecessary reference-counting on strings.
2017-11-16 17:09:32 +03:00
Dmitry Stogov
ce18738a30
Removed "_" from API functions.
2017-11-16 17:09:01 +03:00
zimuyang
b304f3bc0e
Remove duplicate check for already loaded extension
2017-11-16 00:16:15 +01:00
Nikita Popov
1e3f625aa5
Merge branch 'PHP-7.2'
2017-11-15 23:01:52 +01:00
Nikita Popov
6640e03df8
Merge branch 'PHP-7.1' into PHP-7.2
2017-11-15 23:01:25 +01:00
DanielCiochiu
dba5a798a2
Fixed #74862 : Unable to clone instance when private __clone defined
...
Even though __clone was implemented as private and called only from
parent class, child extending class instance could not be cloned.
2017-11-15 23:00:26 +01:00
Anatol Belski
61259d692e
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Fixed #75384 PHP seems incompatible with OneDrive files on demand
bump versions
Fixed ext/date tests due to changes in Olson database
2017-11-08 12:01:39 +01:00
Anatol Belski
01c70cc98b
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fixed #75384 PHP seems incompatible with OneDrive files on demand
bump versions
Fixed ext/date tests due to changes in Olson database
2017-11-08 12:00:30 +01:00
Anatol Belski
d36e793c93
Merge branch 'PHP-7.0' into PHP-7.1
...
* PHP-7.0:
Fixed #75384 PHP seems incompatible with OneDrive files on demand
Fixed ext/date tests due to changes in Olson database
2017-11-08 11:54:18 +01:00
Anatol Belski
c6720e2f45
Fixed #75384 PHP seems incompatible with OneDrive files on demand
2017-11-08 11:52:42 +01:00
Dmitry Stogov
9731a22eba
Use Zend MM heap for non-persistent ini entry values.
2017-11-08 12:01:59 +03:00
Dmitry Stogov
abd2120c4f
Fixed inaccurate condition
2017-11-07 10:29:17 +03:00
Anatol Belski
d6267cd230
Don't touch inline if C++ is compiled
...
Starting with C++11 marco keywords are forbidden by the standard. Things
like inline namespaces would be broken by this part. As any of supported
compilers is at least C++11 complaint, tricks with inline are simply
disabled if C++ is compiled. Though, zend_always_inline is still usable,
anything else about inlining for C++ is up to the compiler.
2017-11-06 13:52:02 +01:00
Sammy Kaye Powers
b591c329ee
Allow trailing commas in function and method calls
2017-11-06 07:13:56 +00:00
Xinchen Hui
4da0bfc7d7
Unused var
2017-11-06 14:10:27 +08:00
Dmitry Stogov
d3fa900780
Removed workaraouns for inconsistent zvals (REFCOUNTED+INTERNED). They should be fixed now.
2017-11-03 21:02:55 +03:00
Dmitry Stogov
7fba7209e1
Fixed memory leak (Zend/tests/list_003.phpt)
2017-11-03 21:02:27 +03:00
Dmitry Stogov
26b2b27a25
Don't intern strings in-place if their refcoung greater than 1
2017-11-03 21:00:07 +03:00
Dmitry Stogov
522cc6926b
erealloc() optimization
2017-11-03 18:35:03 +03:00
Dmitry Stogov
f2b91b31e4
Switch back from "request" interned strings storage to "permanent" in MSHUTDOWN
2017-11-02 23:29:21 +03:00
Pedro Magalhães
897bdb42f0
Fix #74922 - Try to resolve constants when importing trait properties
2017-11-02 21:06:27 +01:00
Nikita Popov
625d7075d6
Don't dup after fetch_dimension_const
...
Any duplication that may be necessary must have happened earlier
already. Also I'm not sure what the IS_REF branch was there for
originally, but it does not appear to be relevant anymore.
2017-11-02 19:20:14 +01:00
Xinchen Hui
d56a534acc
RC manipulation cleanup 2
2017-11-02 12:13:35 +08:00
Xinchen Hui
3fa0cee640
Revert "Use zend_get_executed_filename_ex"
...
This reverts commit 2a37625c20
.
2017-11-02 12:12:40 +08:00
Xinchen Hui
39845250f2
Merge branch 'master' of git.php.net:/php-src
...
* 'master' of git.php.net:/php-src:
Made "result", "statement" and "last_message" to always use Zend MM heap. (even for persistent connections these entities don't relive request boundary)
Fixed memory leaks
Use interned strings for "magic" property of internal classes. (not copyied into SHM)
Reverted incomplete fix and too strict asserts.
Mark persistent connection related data as "thread-local".
Persistent resources are "thread-local". Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
PCRE cache is "thread-local"
Allow reference-counting on "thread-local" persistent zvals
2017-11-02 10:40:45 +08:00
Dmitry Stogov
468fd78bff
Fixed memory leaks
2017-11-02 03:04:27 +03:00
Dmitry Stogov
990d8092a4
Reverted incomplete fix and too strict asserts.
2017-11-01 16:18:13 +03:00
Dmitry Stogov
67d5f39a47
Persistent resources are "thread-local".
...
Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
2017-11-01 15:19:31 +03:00
Dmitry Stogov
cf582a32ef
Allow reference-counting on "thread-local" persistent zvals
2017-11-01 15:11:52 +03:00
Xinchen Hui
a32e567ec8
Merge branch 'master' of git.php.net:/php-src
...
* 'master' of git.php.net:/php-src:
Fixed string interning during constants substitution
2017-11-01 18:42:12 +08:00
Dmitry Stogov
02a05146fd
Fixed string interning during constants substitution
2017-11-01 10:56:37 +03:00
Xinchen Hui
2a37625c20
Use zend_get_executed_filename_ex
2017-11-01 15:40:54 +08:00
Dmitry Stogov
5baf657db3
Revert "Fixed string interning during constants substitution"
...
This reverts commit e0924c52fc
.
2017-11-01 10:39:47 +03:00
Dmitry Stogov
e0924c52fc
Fixed string interning during constants substitution
2017-11-01 10:34:39 +03:00
Xinchen Hui
a8a17a72b0
RC manipulation cleanup
2017-11-01 10:25:10 +08:00
Dmitry Stogov
d481d495cc
Fixed few inconsistent ZVALs in AST produced by compiler (REFCOUNTED and INTERNED strings)
2017-11-01 01:10:21 +03:00
Nikita Popov
5b044aacbe
Use known strings for reflection properties
2017-10-31 15:46:55 +01:00
Dmitry Stogov
b84cbefa94
Change checks that should be always true into ZEND_ASSERT() (some edge cases may be trapped here).
2017-10-31 15:41:51 +03:00
Dmitry Stogov
54ebab9640
Workaroud for inconsistent ZVALs in AST produced by compiler (strings may be REFCOUNTED and INTERNED at the same time).
2017-10-31 15:39:39 +03:00
Dmitry Stogov
5dbdc382af
Intern file names and class constants in first place (they may be interned later during constant substitution)
2017-10-31 15:36:55 +03:00