Commit Graph

266 Commits

Author SHA1 Message Date
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
TAKEKOSHI Akishige
15735678c3 when needle is short, Sunday algorithm is slower than glibc memchr() 2016-09-18 15:46:40 +09:00
Nikita Popov
dd7affa9ff Merge branch 'PHP-7.1' 2016-09-16 21:06:52 +02:00
Nikita Popov
cab7bc7e07 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-16 21:06:11 +02:00
Michael Orlitzky
0e76cafaf1 Disable add/sub asm for gcc 4.9 pic/pie builds 2016-09-16 21:06:02 +02:00
Nikita Popov
e0e5063173 Drop some pieces of commented-out code 2016-09-04 12:56:06 +02:00
Nikita Popov
852a5ff23c Fix typos 2016-08-11 17:57:58 +02:00
Xinchen Hui
75017520c3 Check them in autoconf 2016-08-11 19:57:30 +08:00
Andrea Faulds
9bbbb1bd80 Use checked add/sub intrinsics instead of asm for ++ and -- 2016-08-10 00:46:05 +01:00
Andrea Faulds
0987737397 Use checked arithmetic intrinsics instead of asm, when possible 2016-08-10 00:46:05 +01:00
Dmitry Stogov
1b4946e658 Use "fast" assembler functions in "slow" ones.
Mark assembler functions that changes memory.
2016-06-01 20:52:14 +03:00
Nikita Popov
64f91774f2 Remove IS_VAR_RET_REF flag
Instead decide whether a function returned by reference or by value
by checking whether the return value has REFERENCE type. This means
that functions returning by reference must always return a reference
and functions returning by value must not return a reference.
2016-04-15 15:32:20 +02:00
Andrea Faulds
1e82ad8038 Warn about invalid strings in arithmetic
Squashed commit of the following:

commit e05d3b6732
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Mar 30 01:43:35 2016 +0100

    UPGRADING and NEWS

commit 6caf1d4585
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Mar 20 21:18:33 2016 +0000

    Fixes

commit 6dadb1b0ef
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 02:15:01 2016 +0000

    Add test for numeric string errors in assignment

commit bd5f04e8dd
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 23:53:05 2016 +0000

    Add test for numeric string errors

commit c72e92f16d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:28:33 2016 +0000

    Add test for scientific notation in integer operations

commit d94c08852d
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:25:57 2016 +0000

    Disable optimiser evaluation for numeric string errors

commit 30ee954ed1
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Feb 14 01:46:25 2016 +0000

    fixup

commit a6403b79e0
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 22:00:27 2016 +0000

    Do not convert error-causing numeric strings ahead-of-time

commit f9dc354014
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sat Feb 13 19:15:38 2016 +0000

    Disable compile-time evaluation for numeric string errors

commit e05b0cc849
Author: Andrea Faulds <ajf@ajf.me>
Date:   Fri Feb 5 11:42:26 2016 +0000

    Make _zval_get_long_func_noisy function for inlining

commit 84d66321a5
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 23:10:00 2016 +0000

    Update tests

commit 5ac4a0cc4b
Author: Andrea Faulds <ajf@ajf.me>
Date:   Tue Jan 26 22:08:19 2016 +0000

    Use is_numeric_string_ex for zval_get_long etc.

commit c21f088485
Author: Andrea Faulds <ajf@ajf.me>
Date:   Thu Jan 7 21:13:04 2016 +0000

    Update tests

commit 63e214cf81
Author: Andrea Faulds <ajf@ajf.me>
Date:   Wed Jan 6 00:28:01 2016 +0000

    Warn on non-/bad numeric strings in arithmetic
2016-03-30 01:44:27 +01:00
Nikita Popov
af66ad2857 Remove use of register keyword in headers
Headers must be C++ compatible -- this throws warnings.

The register keyword is not used for optimization, at least not
in optimized builds.
2016-02-04 13:34:19 +01:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Anatol Belski
a3f1154b3d additional catch to bug #70863 2015-11-10 00:38:11 +01:00
Dmitry Stogov
24e88348f3 Revert "Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src"
This reverts commit a6be0f3fd6.
2015-10-06 23:48:12 +03:00
Bob Weinand
a6be0f3fd6 Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src 2015-10-05 14:50:04 +02:00
Xinchen Hui
213b49620d Simplfy zend_is_true 2015-09-10 16:13:22 +08:00
Dmitry Stogov
c174e4cd73 Change array sorting implementation to avoid two level callbacks system.
Simplify zval comparion API.
2015-09-10 02:51:23 +03:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Anatol Belski
ee2e169108 Fixed bug #69896 'asm' operand has impossible constraints
Given it's an issue with 32-bit gcc-4.8, asm is disabled for the
breaking parts.
2015-08-02 09:25:24 +02:00
Anton Blanchard
fd8fb17be8 Improve performance of PowerPC64 fast_long_add_function
Detecting overflow with the XER is slow, partially because we have to
clear it before use.

PHP already has a fast way of detecting overflow in its fallback
c implementation. Overflow only occurs if the signs of the two
operands are the same and the sign of the result is different.
Furthermore, leaving it in c allows gcc to schedule the instructions
better.

This is 9% faster on a POWER8 running a simple testcase:

<?php
        function testcase($count = 100000000) {
		$x = 1;
                for ($i = 0; $i < $count; $i++) {
                        $x = $x + 1;
                        $x = $x + 1;
                        $x = $x + 1;
                        $x = $x + 1;
                        $x = $x + 1;
                }
        }

        testcase();
?>
2015-07-29 09:22:38 +02:00
Anton Blanchard
4d578f28df Improve performance of PowerPC64 fast_long_increment_function
Detecting overflow with the XER is slow, partially because we have to
clear it before use.

gcc does a better job of detecting overflow of an increment or decrement
than we can with inline assembly. It knows that an increment will only
overflow if it is one less than the overflow value. This means we end
up with a simple compare/branch. Furthermore, leaving it in c allows gcc
to schedule the instructions better.

This is 6% faster on a POWER8 running a simple testcase:

<?php
        function testcase($count = 100000000) {
		$x = 1;
                for ($i = 0; $i < $count; $i++) {
                        $x++;
                        $x++;
                        $x++;
                        $x++;
                        $x++;
                }
        }

        testcase();
?>
2015-07-28 18:38:23 +02:00
Nikita Popov
0039a3e96f Fixed signed/unsigned warnings in wddx
Also added extra const annotation to zend_memnstr.
2015-07-17 17:19:23 +02:00
Dmitry Stogov
d2d326a381 Cleanup (avoid reallocatios and side effects in php_strip_tags) 2015-07-01 19:04:18 +03:00
Dmitry Stogov
b97df475df Fixed crash in Zend/tests/bug69891.phpt on x86 (32-bit).
compare_function() now has to be compatible with binary_op_type (use fastcall convention).
Introduced new zval_compare_function() to be used as zval comparison callback instead of compare_function().
2015-06-22 12:53:52 +03:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02:00
Dmitry Stogov
196b951728 Optimized === and !== with NULL, FALSE, TRUE. 2015-05-15 01:11:29 +03:00
Dmitry Stogov
d880ead8a7 Improve fast_is_[not_]identical() functions to teturn value instead of takeing additional arguments.
Pair INSTANCEOF with the following JMPZ/JMPNZ.
2015-04-29 16:43:23 +03:00
Dmitry Stogov
cae0147ed3 Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled. 2015-04-06 14:30:05 +03:00
Kalle Sommer Nielsen
313d01f30a Drop old VC support in Zend Engine, this also kills the remaining MessageBox fix for Windows 9x that Anatol changed a while back 2015-03-29 07:10:39 +02:00
Dmitry Stogov
0ce7b4c8c6 Removed unused functions 2015-03-24 23:40:20 +03:00
Dmitry Stogov
4d4a5336f1 Embed "fast" operator functions (add, sub, increment, etc) into executor with additional optimizations 2015-03-17 18:53:19 +03:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
1cdee9a5d8 Fixed C++ support 2015-02-27 13:45:11 +03:00
Dmitry Stogov
716da71446 Don't inline slow path 2015-02-26 01:28:47 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
2f1ddff2a5 Faster strrpos implementation 2015-01-12 17:24:37 +08:00
Xinchen Hui
31817447cc Faster zend_memnstr for long text 2015-01-12 15:34:46 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Dmitry Stogov
107ae86ca6 Introduce specialized functions to compare with integer and string, to eliminate repeatable checks on each loop iteration in in_array() function. 2014-12-27 11:11:40 +03: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
b5b617674e Micro optimaztion (yeah, I know compiler supposed to do that) 2014-12-22 00:10:46 -05:00
Xinchen Hui
c24125e2f9 Micro optimization 2014-12-21 23:16:25 -05:00
Xinchen Hui
201e1b8a8d Micro optimizations 2014-12-21 22:35:25 -05:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Andrea Faulds
0ea0b591d7 Merge branch 'zppFailOnOverflow'
* zppFailOnOverflow:
  Fix MySQLi tests
  Fixed gd test
  Refactor ZEND_LONG_MAX/MIN checks into ZEND_DOUBLE_FITS_LONG()
  Fixed copy-and-paste error
  Fix more 32-bit tests
  Skip buncha tests on 32-bit
  skip simplexml
  skip posix 32-bit
  skip tests on 32-bit
  Fixes simplexml test
  Fixes posix tests
  Fixes iconv tests
  Marked tests as 32-bit
  Fixed more 32-bit tests
  Fixed some 32-bit tests
  Mark said ext/date tests as 32-bit only
  Fixed ext/date tests broken by zpp error on overflow
  Fixed broken tests
  Make zpp fail if NaN passed for int, or out-of-range float for non-capping int

Conflicts:
	ext/date/tests/getdate_variation7.phpt
	ext/date/tests/localtime_variation3.phpt
2014-12-13 18:38:15 +00:00
Gustavo Frederico Temple Pedrosa
5dbeb9e65e PowerPC64 support for add and sub with overflow check
This adds fast architecture-specific implementations of the
following functions for the ppc64:

* fast_add_function
* fast_sub_function
2014-12-12 10:47:54 +01:00
Gustavo Frederico Temple Pedrosa
fd045c7021 PowerPC64 support for operators with overflow check
This adds fast architecture-specific implementations of
the following functions for the ppc64:

* fast_increment_function
* fast_decrement_function
2014-12-12 10:47:50 +01:00