com php-src: Removed unused zend_object_fetch_property_ type_info() and renamed zend_object_fetch_pro perty_type_info_ex() into zend_object_fetch
_property_type_info(): Zend/zend_execute.h Zend/zend_object_handlers.c ext/standard/var.c

From: Date: Wed, 25 May 2016 14:13:49 +0000
Subject: com php-src: Removed unused zend_object_fetch_property_ type_info() and renamed zend_object_fetch_pro perty_type_info_ex() into zend_object_fetch
_property_type_info(): Zend/zend_execute.h Zend/zend_object_handlers.c ext/standard/var.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95528@lists.php.net to get a copy of this message
Commit: 05dd2e462aab2543a5caf2b9c1cf90d6014c1b27 Author: Dmitry Stogov <dmitry@zend.com> Wed, 25 May 2016 17:13:49 +0300 Parents: 4506a70a26a350b9eb2437983b197f4f7deec3e2 Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=05dd2e462aab2543a5caf2b9c1cf90d6014c1b27 Log: Removed unused zend_object_fetch_property_type_info() and renamed zend_object_fetch_property_type_info_ex() into zend_object_fetch_property_type_info() Changed paths: M Zend/zend_execute.h M Zend/zend_object_handlers.c M ext/standard/var.c Diff: diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 7aa329b..f670eeb 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -366,7 +366,8 @@ void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t #define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS) -static zend_always_inline zend_property_info* zend_object_fetch_property_type_info_ex(zval *object, zend_string *property, void **cache_slot) { +static zend_always_inline zend_property_info* zend_object_fetch_property_type_info(zval *object, zend_string *property, void **cache_slot) +{ zend_property_info *info; /* if we have a cache_slot, let's assume it's valid. Callers task to ensure validity! */ @@ -387,19 +388,6 @@ static zend_always_inline zend_property_info* zend_object_fetch_property_type_in return NULL; } -static zend_always_inline zend_property_info* zend_object_fetch_property_type_info(zval *object, zval *property, void **cache_slot) -{ - if (EXPECTED(cache_slot)) { - return (zend_property_info*) CACHED_PTR_EX(cache_slot + 2); - } - - if (UNEXPECTED(Z_TYPE_P(property) != IS_STRING)) { - return NULL; - } - - return zend_object_fetch_property_type_info_ex(object, Z_STR_P(property), cache_slot); -} - zval* zend_verify_property_type(zend_property_info *info, zval *property, zval *tmp, zend_bool strict); ZEND_COLD void zend_verify_property_type_error(zend_property_info *info, zend_string *name, zval *property); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 8092a81..898b4ec 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -676,7 +676,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ zval_ptr_dtor(&tmp_object); if (UNEXPECTED(ZEND_CLASS_HAS_TYPE_HINTS(zobj->ce) && - (prop_info = zend_object_fetch_property_type_info_ex(object, Z_STR_P(member), cache_slot)))) { + (prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member), cache_slot)))) { zval tmp, *val; val = zend_verify_property_type(prop_info, retval, &tmp, (zobj->ce->__get->common.fn_flags & ZEND_ACC_STRICT_TYPES) != 0); @@ -694,7 +694,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ } } if ((type != BP_VAR_IS)) { - if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info_ex(object, Z_STR_P(member), cache_slot)) + if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member), cache_slot)) && UNEXPECTED(!prop_info->allow_null)) { zend_throw_exception_ex(zend_ce_type_error, prop_info->type, "Typed property %s::$%s must not be accessed before initialization", @@ -737,7 +737,7 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) { variable_ptr = OBJ_PROP(zobj, property_offset); if (Z_TYPE_P(variable_ptr) != IS_UNDEF) { - zend_property_info *prop_info = zend_object_fetch_property_type_info_ex(object, Z_STR_P(member), cache_slot); + zend_property_info *prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member), cache_slot); zval tmp, *val; if (UNEXPECTED(prop_info)) { @@ -806,7 +806,7 @@ write_std_property: zend_property_info *prop_info; zval tmp, *val; - if (cache_slot ? UNEXPECTED(prop_info = (zend_property_info *) CACHED_PTR_EX(cache_slot + 2)) : UNEXPECTED(prop_info = zend_object_fetch_property_type_info_ex(object, Z_STR_P(member), NULL))) { + if (UNEXPECTED(prop_info = zend_object_fetch_property_type_info(object, Z_STR_P(member), cache_slot))) { val = zend_verify_property_type(prop_info, value, &tmp, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data))); if (UNEXPECTED(!val)) { zend_verify_property_type_error(prop_info, Z_STR_P(member), value); diff --git a/ext/standard/var.c b/ext/standard/var.c index 16e05cd..614c35a 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -178,7 +178,7 @@ again: } if (key) { - prop_info = zend_object_fetch_property_type_info_ex(struc, key, NULL); + prop_info = zend_object_fetch_property_type_info(struc, key, NULL); } if (!Z_ISUNDEF_P(val) || prop_info) { @@ -369,7 +369,7 @@ again: } if (key) { - prop_info = zend_object_fetch_property_type_info_ex(struc, key, NULL); + prop_info = zend_object_fetch_property_type_info(struc, key, NULL); } if (!Z_ISUNDEF_P(val) || prop_info) {

« previous php.cvs (#95528) next »