diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2016-04-05 20:09:14 +0300 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2016-04-05 20:09:14 +0300 |
| commit | a186ac0e47023f5b16daf25bd37750138d78ab94 (patch) | |
| tree | 2d31d9651e52e460e58bb846abd7fd9b65b12059 /Zend/zend_execute.c | |
| parent | a5e21665ee001e54d827e703ec6f0a3c7053be85 (diff) | |
| download | php-git-a186ac0e47023f5b16daf25bd37750138d78ab94.tar.gz | |
IS_CONST operands don't have to be separated. Use reference-counting instead of duplication.
- with opcache all IS_CONST operands are not refcounted (scalars, interned strings or immutable arrays)
- without opcache IS_CONST operands are not shared between processes or threads and may use common reference counters
Diffstat (limited to 'Zend/zend_execute.c')
| -rw-r--r-- | Zend/zend_execute.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 006a5a1d7d..86df4f760e 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1090,7 +1090,6 @@ static zend_never_inline void zend_assign_to_object_dim(zval *retval, zval *obje { zend_free_op free_value; zval *value = get_zval_ptr_deref(value_type, value_op, execute_data, &free_value, BP_VAR_R); - zval tmp; /* Note: property_name in this case is really the array index! */ if (!Z_OBJ_HT_P(object)->write_dimension) { @@ -1101,10 +1100,8 @@ static zend_never_inline void zend_assign_to_object_dim(zval *retval, zval *obje /* separate our value if necessary */ if (value_type == IS_CONST) { - if (UNEXPECTED(Z_OPT_COPYABLE_P(value))) { - ZVAL_COPY_VALUE(&tmp, value); - zval_copy_ctor_func(&tmp); - value = &tmp; + if (UNEXPECTED(Z_REFCOUNTED_P(value))) { + Z_ADDREF_P(value); } } |
