com php-src: A cheaper way to reset type flags.: Zend/zend_AP I.c Zend/zend_compile.c ext/opcache/zend_persist. c ext/opcache/zend_persist_calc.c
ext/standard/browsc ap.c

From: Date: Tue, 16 Jan 2018 22:58:51 +0000
Subject: com php-src: A cheaper way to reset type flags.: Zend/zend_AP I.c Zend/zend_compile.c ext/opcache/zend_persist. c ext/opcache/zend_persist_calc.c
ext/standard/browsc ap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100916@lists.php.net to get a copy of this message
Commit: 5c77bac9a74de2e1a16bae22a6f338380f5dc202 Author: Dmitry Stogov <dmitry@zend.com> Wed, 17 Jan 2018 01:58:51 +0300 Parents: 60fb58799fc6c537dd82bb9f5a1e8eeb87bf0ecf Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5c77bac9a74de2e1a16bae22a6f338380f5dc202 Log: A cheaper way to reset type flags. Changed paths: M Zend/zend_API.c M Zend/zend_compile.c M ext/opcache/zend_persist.c M ext/opcache/zend_persist_calc.c M ext/standard/browscap.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 73eb748..79d6ab9 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3624,7 +3624,7 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */ ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING); Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv)); if (ZSTR_IS_INTERNED(Z_STR_P(zv))) { - Z_TYPE_FLAGS_P(zv) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(zv) = 0; } return Z_STR_P(zv); } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 0beadac..a574de9 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -441,7 +441,7 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */ ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING); Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv)); if (ZSTR_IS_INTERNED(Z_STR_P(zv))) { - Z_TYPE_FLAGS_P(zv) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(zv) = 0; } return Z_STR_P(zv); } diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index e9aece7..136255d 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -283,7 +283,7 @@ static void zend_persist_zval(zval *z) switch (Z_TYPE_P(z)) { case IS_STRING: zend_accel_store_interned_string(Z_STR_P(z)); - Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(z) = 0; break; case IS_ARRAY: new_ptr = zend_shared_alloc_get_xlat_entry(Z_ARR_P(z)); @@ -319,12 +319,12 @@ static void zend_persist_zval(zval *z) new_ptr = zend_shared_alloc_get_xlat_entry(Z_AST_P(z)); if (new_ptr) { Z_AST_P(z) = new_ptr; - Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(z) = 0; } else { zend_ast_ref *old_ref = Z_AST_P(z); Z_ARR_P(z) = zend_accel_memdup(Z_AST_P(z), sizeof(zend_ast_ref)); zend_persist_ast(GC_AST(old_ref)); - Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(z) = 0; GC_SET_REFCOUNT(Z_COUNTED_P(z), 2); efree(old_ref); } diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index a99a800..87ce937 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -124,7 +124,7 @@ static void zend_persist_zval_calc(zval *z) case IS_STRING: ADD_INTERNED_STRING(Z_STR_P(z), 0); if (ZSTR_IS_INTERNED(Z_STR_P(z))) { - Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(z) = 0; } break; case IS_ARRAY: diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 32d377d..e58a20c 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -330,7 +330,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb new_value = zend_new_interned_string(zend_string_copy(new_value)); if (ZSTR_IS_INTERNED(new_value)) { if (new_value == Z_STR_P(arg2)) { - Z_TYPE_FLAGS_P(arg2) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(arg2) = 0; } } else { zend_string_release(new_value); @@ -361,7 +361,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb new_key = zend_new_interned_string(zend_string_copy(new_key)); if (ZSTR_IS_INTERNED(new_key)) { if (new_key == Z_STR_P(arg1)) { - Z_TYPE_FLAGS_P(arg1) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(arg1) = 0; } } else { zend_string_release(new_key); @@ -389,7 +389,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb if (persistent) { pattern = zend_new_interned_string(zend_string_copy(pattern)); if (ZSTR_IS_INTERNED(pattern)) { - Z_TYPE_FLAGS_P(arg1) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); + Z_TYPE_FLAGS_P(arg1) = 0; } else { zend_string_release(pattern); }

« previous php.cvs (#100916) next »