Commit Graph

13131 Commits

Author SHA1 Message Date
Dmitry Stogov
6e4d18924b Combine READY_TO_DESTROY, EXTRACT_ZVAL_PTR and FREE_OP_VAR_PTR into single, better optimized, macro. 2017-12-26 16:50:34 +03:00
Dmitry Stogov
6e23e84332 Use zval constructors instead ZVAL_COPY if we know the types 2017-12-26 16:49:34 +03:00
Nikita Popov
b2b2b437af Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an
_IS_NUMBER argument, in which case the cast handler should return
either an integer or floating point number, whichever is more
appropriate.

Previously convert_scalar_to_number() unconditionally converted
objects to integers instead.

Fixes bug #53033.
Fixes bug #54973.
Fixes bug #73108.
2017-12-26 12:39:06 +01:00
Dmitry Stogov
efcbea4345 Cheaper reference construction 2017-12-26 13:30:25 +03:00
Nikita Popov
182317f6b6 Remove unnecessary type check 2017-12-25 21:21:05 +01:00
Nikita Popov
2667ddc46d Remove unnecessary readobj==writeobj checks
This can no longer be the case since PHP 7. The writeobj must
always point to a different zval.
2017-12-25 21:19:45 +01:00
Nikita Popov
688b9136ab Fixed bug #54043 2017-12-23 13:35:08 +01:00
Nikita Popov
66c8a9d672 Remove EH_SUPPRESS mode
It is unused and does not work in any meaningful way:
Warnings are suppressed, but everything else (both notices and
fatals) are not. It would make some sense if it suppressed
warnings and lower, but right now this is a pointless mode.
2017-12-23 13:28:09 +01:00
Dmitry Stogov
35b3fdfd0a Separate exceptional code into cold functions. 2017-12-22 16:35:52 +03:00
Dmitry Stogov
4691cbe5d1 Fixed possible local assembler labels conflicts. 2017-12-20 21:44:24 +03:00
Dmitry Stogov
f860ae451a fixed "unused function" compilation warning 2017-12-18 11:43:12 +03:00
Dmitry Stogov
b337b90bac Fix warning in the proper place 2017-12-18 11:28:59 +03:00
Xinchen Hui
4dfbfe93aa Use cheaper API 2017-12-18 11:55:14 +08:00
Nikita Popov
3fde27d87d Merge branch 'PHP-7.2' 2017-12-16 17:10:09 +01:00
Pedro Magalhães
83964e0468 Fix #75607 - Check if existing static trait property is a ref before comparing 2017-12-16 17:07:12 +01:00
Nikita Popov
93c7a3803f Fix const qualifier warning 2017-12-15 21:58:52 +01:00
Li-Wen Hsu
72ec23d823 Fix bug #75677: Drop fastcall attribute on variadic function
Fastcall generally doesn't make sense on variadic functions. For
clang in particular this eliminates a "fastcall calling convention
ignored on variadic function" warning.
2017-12-15 21:56:08 +01:00
Anatol Belski
32db45ca54 Drop unused code 2017-12-15 14:58:43 +01:00
Anatol Belski
f3f6cd24e9 Modernize realpath and integrate quick variant into virtual_file_ex
The slower I/O as a traditional bottleneck on Windows which is
the target of this patch. The recursive path resolution, while being
an allround solution, is expensive when it comes to the common case.
Files with proper ACLs set can be resolved in one go by usage of specific
API. Those are available since Vista, so actually can be called old. Those
simpler api is used for the cases where no CWD_EXPAND is requested. For
the cases where ACLs are improper, the existing solution based on
FindFirstFile still does good job also partially providing quirks. Cases
involing reparse tags and other non local filesystems are also partially
server by new APIs.

The approach uses both APIs - the quick one for the common case still
integrating realpath cache, and the existing one as a fallback. The tests
show the I/O load drop on the realpath resolution part due to less
system calls for the sub part resolution of paths. In most case it is
justified, as the sub parts were otherwise cached or unused as well. The
realpath() implementation in ioutil is also closer to the POSIX.
2017-12-15 13:23:34 +01:00
Dmitry Stogov
66a604171c Array addition is not commutative 2017-12-15 14:40:19 +03:00
Dmitry Stogov
588f1df7a2 Remove duplicate handlers for commutative operations 2017-12-15 13:42:54 +03:00
Dmitry Stogov
83e495e0fd Move constants into read-only data segment 2017-12-14 22:14:36 +03:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
1db8402208 Move zend_object_iterator_funcs structures into read-only data segment 2017-12-14 14:21:22 +03:00
Dmitry Stogov
175e461369 Use fastcall calling convention for objects and resources API 2017-12-14 13:50:39 +03:00
Dmitry Stogov
3aceab825a Manual loop optimizaton.
Cost of the loops body is still the same, but the loop headers are improved.
2017-12-14 03:39:22 +03:00
Dmitry Stogov
4d19bc2279 Disable some "bad" GCC optimizations 2017-12-14 03:25:20 +03:00
Dmitry Stogov
dd1050fa6c Improved branch prediction and code locality 2017-12-14 02:22:07 +03:00
Nikita Popov
76a001e32a Merge branch 'PHP-7.2' 2017-12-13 21:25:38 +01:00
Nikita Popov
652d30acdc Merge branch 'PHP-7.1' into PHP-7.2 2017-12-13 21:25:21 +01:00
Levi Morrison
580bae4a2c Fix copy-and-paste bugs 2017-12-13 21:25:00 +01:00
Dmitry Stogov
dc47171523 Avoid temporary string creation and destruction. 2017-12-11 18:18:30 +03:00
Anatol Belski
0673aa7f61 Apply calling convention explicitly to the function, not to the decl. 2017-12-11 12:33:27 +01:00
Dmitry Stogov
f3aca3c852 Use "fastcal" calling convention for internal PHP functions on x86 2017-12-11 10:55:15 +03:00
David Walker
6d4de4cf05 Implement list() reference assignments
Support list() reference assignments of the form:

    list(&$a, list(&$b, $c)) = $d;

RFC: https://wiki.php.net/rfc/list_reference_assignment
2017-12-09 13:39:52 +01:00
Anatol Belski
c9274a4c6a Move declarations 2017-12-08 21:41:25 +01:00
Anatol Belski
17d621e7d3 Allow delete-sharing mode for CreateFile by default
This effectively allows a UNIX like semantics for deleting files
with an open handle. Some OS related limitations still persist,
but the Windows 95 times can be considered as definitely over.
2017-12-08 18:14:20 +01:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Dmitry Stogov
747a5928ad Added assertion 2017-12-07 15:01:23 +03:00
Dmitry Stogov
7bc76c408f SEPARATE_STRING() micro optimization 2017-12-07 15:01:04 +03:00
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