Commit Graph

240 Commits

Author SHA1 Message Date
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
Dmitry Stogov
27dc5986df 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().
2014-12-11 13:18:40 +03:00
Andrea Faulds
f90b877f41 Refactor ZEND_LONG_MAX/MIN checks into ZEND_DOUBLE_FITS_LONG() 2014-11-29 02:13:20 +00:00
Dmitry Stogov
089f496799 Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators 2014-10-21 03:24:20 +04:00
Xinchen Hui
5e39d0c19c And this one... 2014-10-03 19:07:02 +08:00
Dmitry Stogov
6a09bdff6a Fixed C++ incompatibility 2014-09-24 20:31:22 +04:00
Andrea Faulds
12b15e5ca4 Merge branch 'master' into integer_semantics 2014-09-21 00:29:48 +01:00
Nikita Popov
31e842472f Make number printing functions less generic
Now that zend_ulong is 64bit on 64bit platforms, it should be
sufficient to always use it, rather than supporting multiple
types.

API changes:
 * _zend_print_unsigned_to_buf and _zend_print_signed_to_buf
   no longer exist.
 * smart_str(ing)_print_long and smart_str(ing)_print_unsigned
   no longer exist.
 * Instead of all these, zend_print_ulong_to_buf and
   zend_print_long_to_buf should be used.
 * smart_str_append_generic_ex no longer exists.
 * smart_str(ing)_append_off_t(_ex) no longer exists, use
   smart_str(ing)_append_long(_ex) instead.
2014-09-19 23:39:07 +02:00
Dmitry Stogov
db6306dd0e Split is_numeric_string_ex() into inline and non-inline parts 2014-09-18 22:19:51 +04:00
Andrea Faulds
545c296ef4 Fixed if/else if ordering 2014-09-17 20:41:20 +01:00
Andrea Faulds
db72160e5a Merge branch 'master' into integer_semantics
Conflicts:
	Zend/zend_operators.h
2014-09-16 13:45:06 +01:00
Anatol Belski
e0ff5238c5 fix negating an unsigned 2014-09-15 19:46:30 +02:00
Nikita Popov
f915b44070 Remove old zend_string_to_double function 2014-09-05 11:20:06 +02:00
Nikita Popov
28e7beea66 Fix zend_longo_str 2014-08-25 22:47:04 +02:00
Nikita Popov
899a1ed59a Merge branch 'ast'
Conflicts:
	Zend/zend_compile.c
2014-08-25 22:04:33 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Andrea Faulds
676ed04d0d Use zend_ polyfilled nan/finite, check finite 2014-08-19 22:03:16 +01:00
Andrea Faulds
cb770cdc03 Cast NaN and Infinity to zero 2014-08-19 20:21:23 +01:00
Anatol Belski
c586133d07 rename zval_get_long and fixes to some string functions 2014-08-18 08:39:39 +02:00
Anatol Belski
f2182ab845 some more pure naming replacements 2014-08-17 21:16:27 +02:00
Anatol Belski
8ee2a4a9b5 first shot on merging the core fro the int64 branch 2014-08-16 11:16:11 +02:00
Dmitry Stogov
27f38798a1 Fast parameter parsing API
This API is experemental. It may be changed or removed.
It should be used only for really often used functions.
(Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
2014-07-11 16:32:20 +04:00
Dmitry Stogov
1b8916886b Speedup string equality check 2014-06-05 19:14:47 +04:00