Commit Graph

444 Commits

Author SHA1 Message Date
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
Bob Weinand
9ca564d5f3 fix bitwise object operations 2015-06-04 16:09:22 +02:00
Bob Weinand
8a1c5d15d2 Use CG(one_char_string) if possible in bitwise string operations
emalloc() is not cheap... Also, a good part of bitwise string ops out there are on single bytes.
2015-06-03 02:57:16 +02:00
Dmitry Stogov
5fc88a9968 Inline IS_LONG value calculation and avoid strtol() call. 2015-05-05 11:09:18 +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
Nikita Popov
23c7f19e41 Undef results for new arithmetic exceptions
For the compound assing case (e.g. $a <<= $b) the result is going
to be dtored, so we have to set *some* value.
2015-04-06 21:52:20 +02:00
Dmitry Stogov
5820be029a 0.0 / 0.0 = NaN 2015-04-06 22:03:44 +03:00
Anatol Belski
f0c533f421 fix build 2015-04-06 13:56:47 +02: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
Dmitry Stogov
53d20140fb Fixed performance degradation introduced with lateast EnfineException related changes.
Restore original errors order in executor.
2015-04-02 03:56:42 +03:00
Dmitry Stogov
ec760d8fff Convert fatal errors into EngineExceptions 2015-04-01 20:01:57 +03:00
Dmitry Stogov
780a8123fe Convert fatal errors into EngineExceptions 2015-04-01 16:48:15 +03:00
Dmitry Stogov
e8672deefc Convert "Unsupported operands" fatal error into EngineException (exceptions can't be thrown at compile-time yet, so unsuported operands in constant expressions are still lead to fatal error). 2015-03-31 13:25:26 +03:00
Dmitry Stogov
0ce7b4c8c6 Removed unused functions 2015-03-24 23:40:20 +03:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +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
f42ebdd4e9 Fixed inconsistency 2015-03-14 15:11:55 +03:00
Dmitry Stogov
db10b72523 Use fastcall calling convention for most critical ZE subsystems. 2015-03-13 21:10:09 +03:00
Dmitry Stogov
716da71446 Don't inline slow path 2015-02-26 01:28:47 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Nikita Popov
d133e68bab Remove support for hex number from is_numeric_string 2015-01-28 22:54:17 +01:00
Nikita Popov
6093c9370b Fix resource leak when casting to string 2015-01-24 23:18:26 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Dmitry Stogov
90c20b4c24 Fixed typo 2015-01-14 21:09:06 +03:00
Dmitry Stogov
2325758624 Improve "instanceof". Interfaces of the left operand should be checked only if the right operand is interafce itself. 2015-01-14 15:06:26 +03:00
Xinchen Hui
2d8fd4b335 Add hinting 2015-01-12 22:06:40 -05: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
Nikita Popov
3e826c9736 Fix the same leak with %= 2015-01-07 23:21:12 +01:00
Nikita Popov
98c2ceacf8 Fix leak for compound shift self-assign error cases 2015-01-07 23:13:45 +01: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
4b26c5d004 Please becareful with the tailed space after slash 2014-12-22 22:59:17 -05:00
Andrea Faulds
b2853e7494 share that hunk of code 2014-12-23 01:51:19 +00: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
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anatol Belski
a857f3a147 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Fix bug #67106 split main fpm config
  split fpm config to two parts. PR#903
  fix typo
  Fix undefined behaviour in strnatcmp
  Fix undefined behaviour in strnatcmp
  Fixed memory leak introduced by 73458e8f
  update NEWS
  move the test to the right place
  Fixed bug #68545 NULL pointer dereference in unserialize.c
2014-12-14 19:44:24 +01:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Andrea Faulds
8c99b65c4d Fixed memory leak introduced by 73458e8f 2014-12-13 21:11:09 +00:00
Dmitry Stogov
2ea5f7aea4 Removed unused variables 2014-12-12 08:09:42 +03:00
Dmitry Stogov
73458e8f19 Replaced zendi_convert_to_long() with _zval_get_long_func() 2014-12-11 15:01:06 +03: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
Dmitry Stogov
5ba4ae7f67 Move checks for references into slow paths of operator functions. Remove duplicate opcode handlers. 2014-12-06 02:14:45 +03:00
Anatol Belski
ac964fbe30 fix datatype mismatches 2014-10-27 16:38:41 +01:00
Xinchen Hui
c584798b05 Useless assignment 2014-10-22 17:30:19 +08: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
Anatol Belski
c1e92d9fed fix C89 compat 2014-09-25 20:28:34 +02:00
krakjoe
eabad90acb fix indentation 2014-09-25 16:31:39 +01:00