Commit graph

195 commits

Author SHA1 Message Date
Tyson Andre
d0fc6dba0c Fix the Z_IMMUTABLE macro - '(' was mismatched
The macro properly has two matching `(` and `)` symbols
after this change.

This typo was causing syntax errors when compiling extensions
using the (deprecated) macro.

This fixes a bug in the PHP 7.3 branch introduced by
742d5a01ed
2018-06-10 21:21:42 +02:00
Dmitry Stogov
683123fa39 Use SSE2 instruction to reset HashTable 2018-05-30 20:17:52 +03:00
Dmitry Stogov
34ed8e53fe Changed worst HashTable load factor from 1.0 to 0.5 2018-05-04 02:41:35 +03:00
Dmitry Stogov
1a63fa6ec9 Implemented Request #76178 (Class constants are slow: they should be inlined at runtime)
Run-time cache is used to eliminate recalculation of constant expression in RECV_INIT opcode (only non reference countable values are cached).
2018-05-03 14:40:18 +03:00
Dmitry Stogov
f1d5168a74 Simplify GC_FLAGS cand CG_INFO checks 2018-02-28 02:36:50 +03:00
Dmitry Stogov
c9e1419fd2 Change CG_TYPE_INFO() layout to provide more room for GC_INFO() 2018-02-28 00:53:30 +03:00
Dmitry Stogov
6f483dc94c Use macros to update specific parts of GC_TYPE_INFO() (direct assignments to GC_TYPE(), GC_FLAGS() and GC_INFO() are prohibited) 2018-02-28 00:52:12 +03:00
Dmitry Stogov
baa9890112 Completely hide GC implementation details into zend_gc.c 2018-02-27 21:08:26 +03:00
Dmitry Stogov
58880e3fc1 Get rid of IS_OBJ_USE_GUARDS and IS_OBJ_HAS_GUARDS flags 2018-02-27 17:38:56 +03:00
Dmitry Stogov
25e0413de1 Simplify REFCOUNTED checks 2018-02-16 15:37:40 +03:00
Dmitry Stogov
02aea893fb Use Z_TYPE_INFO_REFCOUNTED() macro 2018-02-15 21:54:49 +03:00
Dmitry Stogov
ca035f26aa Moved "zval.u2.cache_slot" into free room of "zend_op" 2018-02-05 19:41:47 +03:00
Dmitry Stogov
9a6100f9dd Break dependency between IS_TYPE_REFCOUNTED and ZEND_CALL_FREE_EXTRA_ARGS 2018-02-02 17:38:07 +03:00
Dmitry Stogov
5e8aa036f2 Access extra data stored in zval through macros 2018-01-23 12:56:22 +03:00
Dmitry Stogov
b3e22da745 Use OBJ_FLAGS() macro to access object flags (even if they are currently stored together with GC_FLAGS) 2018-01-22 15:57:00 +03:00
Dmitry Stogov
6fb5568b2d Merge HashTable.u.v.consistency into HashTable.u.v.flags 2018-01-22 15:32:34 +03:00
Dmitry Stogov
742d5a01ed Get rid of IS_TYPE_COPYABLE. 2018-01-19 17:47:26 +03:00
Dmitry Stogov
1ee94f56c4 Removed IS_TYPE_COPYABLE flag from IS_STRING zvals. 2018-01-18 12:41:27 +03:00
Dmitry Stogov
0a336f9421 Moved IS_CONSTANT_VISITED_MARK, used for protection from recursive self-referencing class constants, from zval.u1.v.type_flags into zval.u2.access_flags. 2018-01-18 11:36:04 +03:00
Dmitry Stogov
f8885523bf Clenaup SEPARATE_ZVAL...() macros (the behavior is unchanged) 2018-01-18 02:27:11 +03:00
Dmitry Stogov
b19d81e0da Use zval_copy_ctor_func() instead of _zval_copy_ctor_func(). 2018-01-17 17:46:57 +03:00
Dmitry Stogov
022e029984 Optimize zval_dtor_func() 2018-01-16 00:57:47 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08: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
Dmitry Stogov
7bc76c408f SEPARATE_STRING() micro optimization 2017-12-07 15:01:04 +03:00
Dmitry Stogov
cf582a32ef Allow reference-counting on "thread-local" persistent zvals 2017-11-01 15:11:52 +03:00
Dmitry Stogov
fcc08ce19f Prevent reference-counting on persistent zvals (internal constants, default properties and constants of internal classes).
New macro ZVAL_COPY_OR_DUP() is used perform duplication, if necessary.
This should eliminate related race-coditions in ZTS build and prevent reference-counting bugs after unclean shutdown.
2017-10-30 23:13:10 +03:00
Dmitry Stogov
b1b1a0596f ws 2017-10-30 12:56:08 +03:00
Dmitry Stogov
8203a0668d Merge branch 'master' into rc_debug
* master:
  Use per-request heap instead of system one
  Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases
  Makrk persistent resources and references with GC_PERSISTENT flag
2017-10-27 14:59:09 +03:00
Dmitry Stogov
0136ecb69a Makrk persistent resources and references with GC_PERSISTENT flag 2017-10-27 14:42:06 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
97e7521e49 AST don't have to be COPYABLE anymore. 2017-10-10 15:45:03 +03:00
Dmitry Stogov
dec8b787ee Renumber types and type_flags 2017-10-10 11:10:27 +03:00
Dmitry Stogov
ef5ea48741 Always use IS_CONSTANT_AST (IS_CONSTANT is removed). 2017-10-10 10:11:05 +03:00
Dmitry Stogov
39ded1d5f8 Changed zend_ast_ref structure to use only one allocation, removing dichotomy between heap/arena ASTs. 2017-10-09 16:57:51 +03:00
Dmitry Stogov
254b74b85f HASH_FLAG_PERSISTENT renamed into IS_ARRAY_PERSISTENT and moved into GC_FLAGS (to be consistent with IS_STR_PERSISTENT). 2017-10-06 02:54:14 +03:00
Dmitry Stogov
cb9d81ef4f Refactored recursion pretection 2017-10-06 01:34:50 +03:00
Dmitry Stogov
0b87d4bf29 Removed unused flags 2017-10-05 00:04:59 +03:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Dmitry Stogov
02e6c9c757 ZVAL_COPY_UNREF() micro-optimization 2017-06-02 00:38:09 +03:00
Dmitry Stogov
476866783c Keep Z_IMMUTABLE*() macros for compatibility 2017-05-02 10:00:54 +03:00
Dmitry Stogov
0631b9e9ba Merge branch 'PHP-7.1'
* PHP-7.1:
  typo
2017-02-01 17:38:12 +03:00
Dmitry Stogov
ddf41b505c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  typo
2017-02-01 17:37:40 +03:00
Dmitry Stogov
3f89b630b4 typo 2017-02-01 17:36:55 +03:00
Dmitry Stogov
8456351a4e Merge branch 'PHP-7.1'
* PHP-7.1:
  fixed macro
2017-02-01 16:06:17 +03:00
Dmitry Stogov
8f7f8d3f9b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fixed macro
2017-02-01 16:05:57 +03:00
Dmitry Stogov
15e9aa1706 fixed macro 2017-02-01 16:05:33 +03:00
Dmitry Stogov
141d1ba980 Introduced "zend_type" - an abstraction for type-hinting representation. 2017-01-13 11:37:46 +03:00