Remove leading underscore for _zend_hash_find_known_hash (#7260)

Convert zend_hash_find_ex(..., 1) to zend_hash_find_known_hash(...)
Convert zend_hash_find_ex(..., 0) to zend_hash_find(...)

Also add serializable changes to UPGRADING.INTERNALS summary
This commit is contained in:
Levi Morrison 2021-07-20 17:07:17 -06:00 committed by GitHub
parent 576655e23f
commit ae8647d9d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 171 additions and 168 deletions

View file

@ -6,6 +6,8 @@ PHP 8.1 INTERNALS UPGRADE NOTES
c. zend_get_opcode_id() c. zend_get_opcode_id()
d. Removed support for "p" printf format specifier d. Removed support for "p" printf format specifier
e. ZEND_ATOL() changes e. ZEND_ATOL() changes
f. Non-serializable classes should use ZEND_ACC_NOT_SERIALIZABLE
g. _zend_hash_find_known_hash renamed to zend_hash_find_known_hash
2. Build system changes 2. Build system changes
a. New compiler flags a. New compiler flags
@ -50,6 +52,7 @@ PHP 8.1 INTERNALS UPGRADE NOTES
f. Non-serializable classes should be indicated using the f. Non-serializable classes should be indicated using the
ZEND_ACC_NOT_SERIALIZABLE (@not-serializable in stubs) rather than the ZEND_ACC_NOT_SERIALIZABLE (@not-serializable in stubs) rather than the
zend_class_(un)serialize_deny handlers which are removed. zend_class_(un)serialize_deny handlers which are removed.
g. _zend_hash_find_known_hash has been renamed to zend_hash_find_known_hash.
======================== ========================
2. Build system changes 2. Build system changes

View file

@ -811,7 +811,7 @@ static uint32_t get_internal_func_info(
return 0; return 0;
} }
zval *zv = zend_hash_find_ex(&func_info, callee_func->common.function_name, 1); zval *zv = zend_hash_find_known_hash(&func_info, callee_func->common.function_name);
if (!zv) { if (!zv) {
return 0; return 0;
} }

View file

@ -382,7 +382,7 @@ ZEND_FUNCTION(error_reporting)
zend_ini_entry *p = EG(error_reporting_ini_entry); zend_ini_entry *p = EG(error_reporting_ini_entry);
if (!p) { if (!p) {
zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1); zval *zv = zend_hash_find_known_hash(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING));
if (!zv) { if (!zv) {
/* Ini setting does not exist -- can this happen? */ /* Ini setting does not exist -- can this happen? */
RETURN_LONG(old_error_reporting); RETURN_LONG(old_error_reporting);

View file

@ -1059,7 +1059,7 @@ ZEND_API void function_add_ref(zend_function *function) /* {{{ */
static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zend_string *lcname, zend_op_array *op_array, bool compile_time) /* {{{ */ static zend_never_inline ZEND_COLD ZEND_NORETURN void do_bind_function_error(zend_string *lcname, zend_op_array *op_array, bool compile_time) /* {{{ */
{ {
zval *zv = zend_hash_find_ex(compile_time ? CG(function_table) : EG(function_table), lcname, 1); zval *zv = zend_hash_find_known_hash(compile_time ? CG(function_table) : EG(function_table), lcname);
int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR; int error_level = compile_time ? E_COMPILE_ERROR : E_ERROR;
zend_function *old_function; zend_function *old_function;
@ -1102,7 +1102,7 @@ ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name) /*
rtd_key = lcname + 1; rtd_key = lcname + 1;
zv = zend_hash_find_ex(EG(class_table), Z_STR_P(rtd_key), 1); zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(rtd_key));
if (UNEXPECTED(!zv)) { if (UNEXPECTED(!zv)) {
ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(lcname)); ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(lcname));
@ -1114,7 +1114,7 @@ ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name) /*
ZEND_ASSERT(EG(current_execute_data)->func->op_array.fn_flags & ZEND_ACC_PRELOADED); ZEND_ASSERT(EG(current_execute_data)->func->op_array.fn_flags & ZEND_ACC_PRELOADED);
if (zend_preload_autoload if (zend_preload_autoload
&& zend_preload_autoload(EG(current_execute_data)->func->op_array.filename) == SUCCESS) { && zend_preload_autoload(EG(current_execute_data)->func->op_array.filename) == SUCCESS) {
zv = zend_hash_find_ex(EG(class_table), Z_STR_P(rtd_key), 1); zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(rtd_key));
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
break; break;
} }
@ -1383,7 +1383,7 @@ ZEND_API void zend_do_delayed_early_binding(zend_op_array *op_array, uint32_t fi
while (opline_num != (uint32_t)-1) { while (opline_num != (uint32_t)-1) {
const zend_op *opline = &op_array->opcodes[opline_num]; const zend_op *opline = &op_array->opcodes[opline_num];
zval *lcname = RT_CONSTANT(opline, opline->op1); zval *lcname = RT_CONSTANT(opline, opline->op1);
zval *zv = zend_hash_find_ex(EG(class_table), Z_STR_P(lcname + 1), 1); zval *zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(lcname + 1));
if (zv) { if (zv) {
zend_class_entry *ce = Z_CE_P(zv); zend_class_entry *ce = Z_CE_P(zv);

View file

@ -547,14 +547,14 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /*
smart_str_append_long(str, num); smart_str_append_long(str, num);
smart_str_appendc(str, ' '); smart_str_appendc(str, ' ');
file = zend_hash_find_ex(ht, ZSTR_KNOWN(ZEND_STR_FILE), 1); file = zend_hash_find_known_hash(ht, ZSTR_KNOWN(ZEND_STR_FILE));
if (file) { if (file) {
if (Z_TYPE_P(file) != IS_STRING) { if (Z_TYPE_P(file) != IS_STRING) {
zend_error(E_WARNING, "File name is not a string"); zend_error(E_WARNING, "File name is not a string");
smart_str_appends(str, "[unknown file]: "); smart_str_appends(str, "[unknown file]: ");
} else{ } else{
zend_long line = 0; zend_long line = 0;
tmp = zend_hash_find_ex(ht, ZSTR_KNOWN(ZEND_STR_LINE), 1); tmp = zend_hash_find_known_hash(ht, ZSTR_KNOWN(ZEND_STR_LINE));
if (tmp) { if (tmp) {
if (Z_TYPE_P(tmp) == IS_LONG) { if (Z_TYPE_P(tmp) == IS_LONG) {
line = Z_LVAL_P(tmp); line = Z_LVAL_P(tmp);
@ -574,7 +574,7 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /*
TRACE_APPEND_KEY(ZSTR_KNOWN(ZEND_STR_TYPE)); TRACE_APPEND_KEY(ZSTR_KNOWN(ZEND_STR_TYPE));
TRACE_APPEND_KEY(ZSTR_KNOWN(ZEND_STR_FUNCTION)); TRACE_APPEND_KEY(ZSTR_KNOWN(ZEND_STR_FUNCTION));
smart_str_appendc(str, '('); smart_str_appendc(str, '(');
tmp = zend_hash_find_ex(ht, ZSTR_KNOWN(ZEND_STR_ARGS), 1); tmp = zend_hash_find_known_hash(ht, ZSTR_KNOWN(ZEND_STR_ARGS));
if (tmp) { if (tmp) {
if (Z_TYPE_P(tmp) == IS_ARRAY) { if (Z_TYPE_P(tmp) == IS_ARRAY) {
size_t last_len = ZSTR_LEN(str->s); size_t last_len = ZSTR_LEN(str->s);

View file

@ -2554,7 +2554,7 @@ num_idx:
return zend_hash_index_find(ht, hval); return zend_hash_index_find(ht, hval);
} else if (Z_TYPE_P(offset) == IS_NULL) { } else if (Z_TYPE_P(offset) == IS_NULL) {
str_idx: str_idx:
return zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1); return zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC());
} else if (Z_TYPE_P(offset) == IS_FALSE) { } else if (Z_TYPE_P(offset) == IS_FALSE) {
hval = 0; hval = 0;
goto num_idx; goto num_idx;
@ -2866,7 +2866,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
ptr = zend_hash_find_ex(zobj->properties, Z_STR_P(prop_ptr), 1); ptr = zend_hash_find_known_hash(zobj->properties, Z_STR_P(prop_ptr));
if (EXPECTED(ptr)) { if (EXPECTED(ptr)) {
ZVAL_INDIRECT(result, ptr); ZVAL_INDIRECT(result, ptr);
return; return;
@ -4398,12 +4398,12 @@ static zend_always_inline zend_result _zend_quick_get_constant(
zend_constant *c = NULL; zend_constant *c = NULL;
/* null/true/false are resolved during compilation, so don't check for them here. */ /* null/true/false are resolved during compilation, so don't check for them here. */
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1); zv = zend_hash_find_known_hash(EG(zend_constants), Z_STR_P(key));
if (zv) { if (zv) {
c = (zend_constant*)Z_PTR_P(zv); c = (zend_constant*)Z_PTR_P(zv);
} else if (flags & IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE) { } else if (flags & IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE) {
key++; key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1); zv = zend_hash_find_known_hash(EG(zend_constants), Z_STR_P(key));
if (zv) { if (zv) {
c = (zend_constant*)Z_PTR_P(zv); c = (zend_constant*)Z_PTR_P(zv);
} }

View file

@ -1617,7 +1617,7 @@ ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data) /* {{{ *
zval *var = EX_VAR_NUM(0); zval *var = EX_VAR_NUM(0);
do { do {
zval *zv = zend_hash_find_ex(ht, *str, 1); zval *zv = zend_hash_find_known_hash(ht, *str);
if (zv) { if (zv) {
if (Z_TYPE_P(zv) == IS_INDIRECT) { if (Z_TYPE_P(zv) == IS_INDIRECT) {

View file

@ -2270,7 +2270,7 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *ke
return p ? &p->val : NULL; return p ? &p->val : NULL;
} }
ZEND_API zval* ZEND_FASTCALL _zend_hash_find_known_hash(const HashTable *ht, zend_string *key) ZEND_API zval* ZEND_FASTCALL zend_hash_find_known_hash(const HashTable *ht, zend_string *key)
{ {
Bucket *p; Bucket *p;

View file

@ -177,13 +177,13 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char
ZEND_API zval* ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h); ZEND_API zval* ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h);
ZEND_API zval* ZEND_FASTCALL _zend_hash_index_find(const HashTable *ht, zend_ulong h); ZEND_API zval* ZEND_FASTCALL _zend_hash_index_find(const HashTable *ht, zend_ulong h);
/* The same as zend_hash_find(), but hash value of the key must be already calculated */ /* The same as zend_hash_find(), but hash value of the key must be already calculated. */
ZEND_API zval* ZEND_FASTCALL _zend_hash_find_known_hash(const HashTable *ht, zend_string *key); ZEND_API zval* ZEND_FASTCALL zend_hash_find_known_hash(const HashTable *ht, zend_string *key);
static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, bool known_hash) static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, bool known_hash)
{ {
if (known_hash) { if (known_hash) {
return _zend_hash_find_known_hash(ht, key); return zend_hash_find_known_hash(ht, key);
} else { } else {
return zend_hash_find(ht, key); return zend_hash_find(ht, key);
} }

View file

@ -1160,7 +1160,7 @@ static zend_never_inline void do_inheritance_check_on_method(
static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, bool is_interface, bool checked) /* {{{ */ static zend_always_inline void do_inherit_method(zend_string *key, zend_function *parent, zend_class_entry *ce, bool is_interface, bool checked) /* {{{ */
{ {
zval *child = zend_hash_find_ex(&ce->function_table, key, 1); zval *child = zend_hash_find_known_hash(&ce->function_table, key);
if (child) { if (child) {
zend_function *func = (zend_function*)Z_PTR_P(child); zend_function *func = (zend_function*)Z_PTR_P(child);
@ -1235,7 +1235,7 @@ static void emit_incompatible_property_error(
static void do_inherit_property(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce) /* {{{ */ static void do_inherit_property(zend_property_info *parent_info, zend_string *key, zend_class_entry *ce) /* {{{ */
{ {
zval *child = zend_hash_find_ex(&ce->properties_info, key, 1); zval *child = zend_hash_find_known_hash(&ce->properties_info, key);
zend_property_info *child_info; zend_property_info *child_info;
if (UNEXPECTED(child)) { if (UNEXPECTED(child)) {
@ -1340,7 +1340,7 @@ static void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_en
static void do_inherit_class_constant(zend_string *name, zend_class_constant *parent_const, zend_class_entry *ce) /* {{{ */ static void do_inherit_class_constant(zend_string *name, zend_class_constant *parent_const, zend_class_entry *ce) /* {{{ */
{ {
zval *zv = zend_hash_find_ex(&ce->constants_table, name, 1); zval *zv = zend_hash_find_known_hash(&ce->constants_table, name);
zend_class_constant *c; zend_class_constant *c;
if (zv != NULL) { if (zv != NULL) {
@ -1644,7 +1644,7 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par
static bool do_inherit_constant_check( static bool do_inherit_constant_check(
zend_class_entry *ce, zend_class_constant *parent_constant, zend_string *name zend_class_entry *ce, zend_class_constant *parent_constant, zend_string *name
) { ) {
zval *zv = zend_hash_find_ex(&ce->constants_table, name, 1); zval *zv = zend_hash_find_known_hash(&ce->constants_table, name);
if (zv == NULL) { if (zv == NULL) {
return true; return true;
} }
@ -2870,7 +2870,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
if (traits_and_interfaces) { if (traits_and_interfaces) {
free_alloca(traits_and_interfaces, use_heap); free_alloca(traits_and_interfaces, use_heap);
} }
zv = zend_hash_find_ex(CG(class_table), key, 1); zv = zend_hash_find_known_hash(CG(class_table), key);
Z_CE_P(zv) = ret; Z_CE_P(zv) = ret;
if (ZSTR_HAS_CE_CACHE(ret->name)) { if (ZSTR_HAS_CE_CACHE(ret->name)) {
ZSTR_SET_CE_CACHE(ret->name, ret); ZSTR_SET_CE_CACHE(ret->name, ret);
@ -2888,7 +2888,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
} }
/* Lazy class loading */ /* Lazy class loading */
ce = zend_lazy_class_load(ce); ce = zend_lazy_class_load(ce);
zv = zend_hash_find_ex(CG(class_table), key, 1); zv = zend_hash_find_known_hash(CG(class_table), key);
Z_CE_P(zv) = ce; Z_CE_P(zv) = ce;
if (CG(unlinked_uses) if (CG(unlinked_uses)
&& zend_hash_index_del(CG(unlinked_uses), (zend_long)(zend_uintptr_t)proto) == SUCCESS) { && zend_hash_index_del(CG(unlinked_uses), (zend_long)(zend_uintptr_t)proto) == SUCCESS) {
@ -2898,7 +2898,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
/* Lazy class loading */ /* Lazy class loading */
ce = zend_lazy_class_load(ce); ce = zend_lazy_class_load(ce);
ce->ce_flags &= ~ZEND_ACC_FILE_CACHED; ce->ce_flags &= ~ZEND_ACC_FILE_CACHED;
zv = zend_hash_find_ex(CG(class_table), key, 1); zv = zend_hash_find_known_hash(CG(class_table), key);
Z_CE_P(zv) = ce; Z_CE_P(zv) = ce;
if (CG(unlinked_uses) if (CG(unlinked_uses)
&& zend_hash_index_del(CG(unlinked_uses), (zend_long)(zend_uintptr_t)proto) == SUCCESS) { && zend_hash_index_del(CG(unlinked_uses), (zend_long)(zend_uintptr_t)proto) == SUCCESS) {
@ -2987,7 +2987,7 @@ ZEND_API zend_class_entry *zend_do_link_class(zend_class_entry *ce, zend_string
ce->inheritance_cache = NULL; ce->inheritance_cache = NULL;
new_ce = zend_inheritance_cache_add(ce, proto, parent, traits_and_interfaces, ht); new_ce = zend_inheritance_cache_add(ce, proto, parent, traits_and_interfaces, ht);
if (new_ce) { if (new_ce) {
zv = zend_hash_find_ex(CG(class_table), key, 1); zv = zend_hash_find_known_hash(CG(class_table), key);
ce = new_ce; ce = new_ce;
Z_CE_P(zv) = ce; Z_CE_P(zv) = ce;
} }
@ -3019,7 +3019,7 @@ static inheritance_status zend_can_early_bind(zend_class_entry *ce, zend_class_e
inheritance_status overall_status = INHERITANCE_SUCCESS; inheritance_status overall_status = INHERITANCE_SUCCESS;
ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, parent_func) { ZEND_HASH_FOREACH_STR_KEY_PTR(&parent_ce->function_table, key, parent_func) {
zval *zv = zend_hash_find_ex(&ce->function_table, key, 1); zval *zv = zend_hash_find_known_hash(&ce->function_table, key);
if (zv) { if (zv) {
zend_function *child_func = Z_FUNC_P(zv); zend_function *child_func = Z_FUNC_P(zv);
inheritance_status status = inheritance_status status =
@ -3041,7 +3041,7 @@ static inheritance_status zend_can_early_bind(zend_class_entry *ce, zend_class_e
continue; continue;
} }
zv = zend_hash_find_ex(&ce->properties_info, key, 1); zv = zend_hash_find_known_hash(&ce->properties_info, key);
if (zv) { if (zv) {
zend_property_info *child_info = Z_PTR_P(zv); zend_property_info *child_info = Z_PTR_P(zv);
if (ZEND_TYPE_IS_SET(child_info->type)) { if (ZEND_TYPE_IS_SET(child_info->type)) {
@ -3146,7 +3146,7 @@ zend_class_entry *zend_try_early_bind(zend_class_entry *ce, zend_class_entry *pa
ce->inheritance_cache = NULL; ce->inheritance_cache = NULL;
new_ce = zend_inheritance_cache_add(ce, proto, parent_ce, NULL, ht); new_ce = zend_inheritance_cache_add(ce, proto, parent_ce, NULL, ht);
if (new_ce) { if (new_ce) {
zval *zv = zend_hash_find_ex(CG(class_table), lcname, 1); zval *zv = zend_hash_find_known_hash(CG(class_table), lcname);
ce = new_ce; ce = new_ce;
Z_CE_P(zv) = ce; Z_CE_P(zv) = ce;
} }

View file

@ -1847,10 +1847,10 @@ ZEND_API int zend_std_cast_object_tostring(zend_object *readobj, zval *writeobj,
ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */ ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only) /* {{{ */
{ {
zval *func;
zend_class_entry *ce = obj->ce; zend_class_entry *ce = obj->ce;
zval *func = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE));
if ((func = zend_hash_find_ex(&ce->function_table, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE), 1)) == NULL) { if (func == NULL) {
return FAILURE; return FAILURE;
} }
*fptr_ptr = Z_FUNC_P(func); *fptr_ptr = Z_FUNC_P(func);

View file

@ -2080,7 +2080,7 @@ ZEND_VM_C_LABEL(fetch_obj_r_fast_copy):
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -2236,7 +2236,7 @@ ZEND_VM_C_LABEL(fetch_obj_is_fast_copy):
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -2402,7 +2402,7 @@ ZEND_VM_C_LABEL(fast_assign_obj):
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
ZEND_VM_C_GOTO(fast_assign_obj); ZEND_VM_C_GOTO(fast_assign_obj);
} }
@ -3676,7 +3676,7 @@ ZEND_VM_HOT_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT)
fbc = CACHED_PTR(opline->result.num); fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) { if (UNEXPECTED(fbc == NULL)) {
function_name = (zval*)RT_CONSTANT(opline, opline->op2); function_name = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(function_name+1), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(function_name+1));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
} }
@ -3820,9 +3820,9 @@ ZEND_VM_HOT_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT)
fbc = CACHED_PTR(opline->result.num); fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) { if (UNEXPECTED(fbc == NULL)) {
func_name = (zval *)RT_CONSTANT(opline, opline->op2); func_name = (zval *)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name + 1), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 1));
if (func == NULL) { if (func == NULL) {
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name + 2), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 2));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
} }
@ -3853,7 +3853,7 @@ ZEND_VM_HOT_HANDLER(61, ZEND_INIT_FCALL, NUM, CONST, NUM|CACHE_SLOT)
fbc = CACHED_PTR(opline->result.num); fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) { if (UNEXPECTED(fbc == NULL)) {
fname = (zval*)RT_CONSTANT(opline, opline->op2); fname = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(fname), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper); ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
} }
@ -5836,7 +5836,7 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
} }
} }
zv = zend_hash_find_ex(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)), 1); zv = zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
c = Z_PTR_P(zv); c = Z_PTR_P(zv);
scope = EX(func)->op_array.scope; scope = EX(func)->op_array.scope;
@ -7336,7 +7336,7 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
/* Do not silence fatal errors */ /* Do not silence fatal errors */
EG(error_reporting) &= E_FATAL_ERRORS; EG(error_reporting) &= E_FATAL_ERRORS;
if (!EG(error_reporting_ini_entry)) { if (!EG(error_reporting_ini_entry)) {
zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1); zval *zv = zend_hash_find_known_hash(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING));
if (zv) { if (zv) {
EG(error_reporting_ini_entry) = (zend_ini_entry *)Z_PTR_P(zv); EG(error_reporting_ini_entry) = (zend_ini_entry *)Z_PTR_P(zv);
} else { } else {
@ -7585,7 +7585,7 @@ ZEND_VM_HANDLER(145, ZEND_DECLARE_CLASS_DELAYED, CONST, CONST)
ce = CACHED_PTR(opline->extended_value); ce = CACHED_PTR(opline->extended_value);
if (ce == NULL) { if (ce == NULL) {
lcname = RT_CONSTANT(opline, opline->op1); lcname = RT_CONSTANT(opline, opline->op1);
zv = zend_hash_find_ex(EG(class_table), Z_STR_P(lcname + 1), 1); zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(lcname + 1));
if (zv) { if (zv) {
SAVE_OPLINE(); SAVE_OPLINE();
ce = Z_CE_P(zv); ce = Z_CE_P(zv);
@ -7616,14 +7616,14 @@ ZEND_VM_HANDLER(146, ZEND_DECLARE_ANON_CLASS, ANY, ANY, CACHE_SLOT)
ce = CACHED_PTR(opline->extended_value); ce = CACHED_PTR(opline->extended_value);
if (UNEXPECTED(ce == NULL)) { if (UNEXPECTED(ce == NULL)) {
zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1)); zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1));
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1); zv = zend_hash_find_known_hash(EG(class_table), rtd_key);
if (UNEXPECTED(zv == NULL)) { if (UNEXPECTED(zv == NULL)) {
SAVE_OPLINE(); SAVE_OPLINE();
do { do {
ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED); ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED);
if (zend_preload_autoload if (zend_preload_autoload
&& zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) { && zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) {
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1); zv = zend_hash_find_known_hash(EG(class_table), rtd_key);
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
break; break;
} }
@ -8286,7 +8286,7 @@ ZEND_VM_HOT_HANDLER(168, ZEND_BIND_GLOBAL, CV, CONST, CACHE_SLOT)
} }
} }
value = zend_hash_find_ex(&EG(symbol_table), varname, 1); value = zend_hash_find_known_hash(&EG(symbol_table), varname);
if (UNEXPECTED(value == NULL)) { if (UNEXPECTED(value == NULL)) {
value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval)); value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval));
idx = (char*)value - (char*)EG(symbol_table).arData; idx = (char*)value - (char*)EG(symbol_table).arData;
@ -8971,7 +8971,7 @@ ZEND_VM_COLD_CONSTCONST_HANDLER(189, ZEND_IN_ARRAY, CONST|TMP|VAR|CV, CONST, NUM
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
FREE_OP1(); FREE_OP1();
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
@ -8990,7 +8990,7 @@ ZEND_VM_COLD_CONSTCONST_HANDLER(189, ZEND_IN_ARRAY, CONST|TMP|VAR|CV, CONST, NUM
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
} }
} }
result = zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1); result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC());
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else { } else {
zend_string *key; zend_string *key;
@ -8999,7 +8999,7 @@ ZEND_VM_COLD_CONSTCONST_HANDLER(189, ZEND_IN_ARRAY, CONST|TMP|VAR|CV, CONST, NUM
if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
FREE_OP1(); FREE_OP1();
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} }

View file

@ -2860,7 +2860,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEN
/* Do not silence fatal errors */ /* Do not silence fatal errors */
EG(error_reporting) &= E_FATAL_ERRORS; EG(error_reporting) &= E_FATAL_ERRORS;
if (!EG(error_reporting_ini_entry)) { if (!EG(error_reporting_ini_entry)) {
zval *zv = zend_hash_find_ex(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING), 1); zval *zv = zend_hash_find_known_hash(EG(ini_directives), ZSTR_KNOWN(ZEND_STR_ERROR_REPORTING));
if (zv) { if (zv) {
EG(error_reporting_ini_entry) = (zend_ini_entry *)Z_PTR_P(zv); EG(error_reporting_ini_entry) = (zend_ini_entry *)Z_PTR_P(zv);
} else { } else {
@ -2928,14 +2928,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_CLASS_SPEC_HANDLE
ce = CACHED_PTR(opline->extended_value); ce = CACHED_PTR(opline->extended_value);
if (UNEXPECTED(ce == NULL)) { if (UNEXPECTED(ce == NULL)) {
zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1)); zend_string *rtd_key = Z_STR_P(RT_CONSTANT(opline, opline->op1));
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1); zv = zend_hash_find_known_hash(EG(class_table), rtd_key);
if (UNEXPECTED(zv == NULL)) { if (UNEXPECTED(zv == NULL)) {
SAVE_OPLINE(); SAVE_OPLINE();
do { do {
ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED); ZEND_ASSERT(EX(func)->op_array.fn_flags & ZEND_ACC_PRELOADED);
if (zend_preload_autoload if (zend_preload_autoload
&& zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) { && zend_preload_autoload(EX(func)->op_array.filename) == SUCCESS) {
zv = zend_hash_find_ex(EG(class_table), rtd_key, 1); zv = zend_hash_find_known_hash(EG(class_table), rtd_key);
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
break; break;
} }
@ -3537,7 +3537,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME
fbc = CACHED_PTR(opline->result.num); fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) { if (UNEXPECTED(fbc == NULL)) {
function_name = (zval*)RT_CONSTANT(opline, opline->op2); function_name = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(function_name+1), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(function_name+1));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
} }
@ -3619,9 +3619,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_N
fbc = CACHED_PTR(opline->result.num); fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) { if (UNEXPECTED(fbc == NULL)) {
func_name = (zval *)RT_CONSTANT(opline, opline->op2); func_name = (zval *)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name + 1), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 1));
if (func == NULL) { if (func == NULL) {
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name + 2), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 2));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
} }
@ -3652,7 +3652,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CO
fbc = CACHED_PTR(opline->result.num); fbc = CACHED_PTR(opline->result.num);
if (UNEXPECTED(fbc == NULL)) { if (UNEXPECTED(fbc == NULL)) {
fname = (zval*)RT_CONSTANT(opline, opline->op2); fname = (zval*)RT_CONSTANT(opline, opline->op2);
func = zend_hash_find_ex(EG(function_table), Z_STR_P(fname), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(fname));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)); ZEND_VM_TAIL_CALL(zend_undefined_function_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
} }
@ -6271,7 +6271,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -6389,7 +6389,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -7032,7 +7032,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONS
} }
} }
zv = zend_hash_find_ex(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)), 1); zv = zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
c = Z_PTR_P(zv); c = Z_PTR_P(zv);
scope = EX(func)->op_array.scope; scope = EX(func)->op_array.scope;
@ -7351,7 +7351,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CLASS_DELAYED_SPEC_CON
ce = CACHED_PTR(opline->extended_value); ce = CACHED_PTR(opline->extended_value);
if (ce == NULL) { if (ce == NULL) {
lcname = RT_CONSTANT(opline, opline->op1); lcname = RT_CONSTANT(opline, opline->op1);
zv = zend_hash_find_ex(EG(class_table), Z_STR_P(lcname + 1), 1); zv = zend_hash_find_known_hash(EG(class_table), Z_STR_P(lcname + 1));
if (zv) { if (zv) {
SAVE_OPLINE(); SAVE_OPLINE();
ce = Z_CE_P(zv); ce = Z_CE_P(zv);
@ -7654,7 +7654,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CON
if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
@ -7673,7 +7673,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CON
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
} }
} }
result = zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1); result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC());
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else { } else {
zend_string *key; zend_string *key;
@ -7682,7 +7682,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CON
if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} }
@ -8599,7 +8599,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -8717,7 +8717,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -10951,7 +10951,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -11069,7 +11069,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -15371,7 +15371,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -15489,7 +15489,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -16791,7 +16791,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -16909,7 +16909,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -18103,7 +18103,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -18221,7 +18221,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -19823,7 +19823,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLE
if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
@ -19842,7 +19842,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLE
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
} }
} }
result = zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1); result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC());
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else { } else {
zend_string *key; zend_string *key;
@ -19851,7 +19851,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLE
if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} }
@ -22816,7 +22816,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -22947,7 +22947,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -23078,7 +23078,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -23209,7 +23209,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -24329,7 +24329,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_
} }
} }
zv = zend_hash_find_ex(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)), 1); zv = zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
c = Z_PTR_P(zv); c = Z_PTR_P(zv);
scope = EX(func)->op_array.scope; scope = EX(func)->op_array.scope;
@ -24761,7 +24761,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLE
if ((IS_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
@ -24780,7 +24780,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLE
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
} }
} }
result = zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1); result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC());
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else { } else {
zend_string *key; zend_string *key;
@ -24789,7 +24789,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLE
if ((IS_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_VAR & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} }
@ -25374,7 +25374,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -25505,7 +25505,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -25636,7 +25636,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -25767,7 +25767,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -29299,7 +29299,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -29430,7 +29430,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -29561,7 +29561,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -29692,7 +29692,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -31407,7 +31407,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -31568,7 +31568,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -31699,7 +31699,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -31830,7 +31830,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -31961,7 +31961,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -32092,7 +32092,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -32691,7 +32691,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUS
} }
} }
zv = zend_hash_find_ex(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)), 1); zv = zend_hash_find_known_hash(CE_CONSTANTS_TABLE(ce), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
if (EXPECTED(zv != NULL)) { if (EXPECTED(zv != NULL)) {
c = Z_PTR_P(zv); c = Z_PTR_P(zv);
scope = EX(func)->op_array.scope; scope = EX(func)->op_array.scope;
@ -33265,7 +33265,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -33421,7 +33421,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -33552,7 +33552,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -33683,7 +33683,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -33814,7 +33814,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -33945,7 +33945,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -35735,7 +35735,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -35891,7 +35891,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -36022,7 +36022,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -36153,7 +36153,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -36284,7 +36284,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -36415,7 +36415,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -39871,7 +39871,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -40032,7 +40032,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -40163,7 +40163,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -40294,7 +40294,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -40425,7 +40425,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -40556,7 +40556,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -42236,7 +42236,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_C
} }
} }
value = zend_hash_find_ex(&EG(symbol_table), varname, 1); value = zend_hash_find_known_hash(&EG(symbol_table), varname);
if (UNEXPECTED(value == NULL)) { if (UNEXPECTED(value == NULL)) {
value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval)); value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval));
idx = (char*)value - (char*)EG(symbol_table).arData; idx = (char*)value - (char*)EG(symbol_table).arData;
@ -42313,7 +42313,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER
if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) { } else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
@ -42332,7 +42332,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
} }
} }
result = zend_hash_find_ex(ht, ZSTR_EMPTY_ALLOC(), 1); result = zend_hash_find_known_hash(ht, ZSTR_EMPTY_ALLOC());
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} else { } else {
zend_string *key; zend_string *key;
@ -42341,7 +42341,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER
if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_TYPE_P(op1) == IS_REFERENCE) {
op1 = Z_REFVAL_P(op1); op1 = Z_REFVAL_P(op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) { if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_find_ex(ht, Z_STR_P(op1), 0); result = zend_hash_find(ht, Z_STR_P(op1));
ZEND_VM_SMART_BRANCH(result, 0); ZEND_VM_SMART_BRANCH(result, 0);
} }
@ -43504,7 +43504,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -43660,7 +43660,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -43791,7 +43791,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -43922,7 +43922,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -44053,7 +44053,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -44184,7 +44184,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -48532,7 +48532,7 @@ fetch_obj_r_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -48688,7 +48688,7 @@ fetch_obj_is_fast_copy:
} }
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; uintptr_t idx = (char*)retval - (char*)zobj->properties->arData;
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
@ -48819,7 +48819,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -48950,7 +48950,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -49081,7 +49081,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }
@ -49212,7 +49212,7 @@ fast_assign_obj:
} }
zobj->properties = zend_array_dup(zobj->properties); zobj->properties = zend_array_dup(zobj->properties);
} }
property_val = zend_hash_find_ex(zobj->properties, name, 1); property_val = zend_hash_find_known_hash(zobj->properties, name);
if (property_val) { if (property_val) {
goto fast_assign_obj; goto fast_assign_obj;
} }

View file

@ -5144,7 +5144,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o
| EXT_CALL zend_hash_find, REG0 | EXT_CALL zend_hash_find, REG0
|1: |1:
} else { } else {
| EXT_CALL _zend_hash_find_known_hash, REG0 | EXT_CALL zend_hash_find_known_hash, REG0
} }
| mov REG0, RETVALx | mov REG0, RETVALx
if (not_found_exit_addr) { if (not_found_exit_addr) {
@ -5168,7 +5168,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o
| EXT_CALL zend_hash_find, REG0 | EXT_CALL zend_hash_find, REG0
|1: |1:
} else { } else {
| EXT_CALL _zend_hash_find_known_hash, REG0 | EXT_CALL zend_hash_find_known_hash, REG0
} }
| mov REG0, RETVALx | mov REG0, RETVALx
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE && type == BP_VAR_R) { if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE && type == BP_VAR_R) {
@ -13300,13 +13300,13 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o
} }
} else if (opline->opcode == ZEND_SWITCH_STRING) { } else if (opline->opcode == ZEND_SWITCH_STRING) {
if (Z_TYPE_P(zv) == IS_STRING) { if (Z_TYPE_P(zv) == IS_STRING) {
jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(zv), 1); jump_zv = zend_hash_find_known_hash(jumptable, Z_STR_P(zv));
} }
} else if (opline->opcode == ZEND_MATCH) { } else if (opline->opcode == ZEND_MATCH) {
if (Z_TYPE_P(zv) == IS_LONG) { if (Z_TYPE_P(zv) == IS_LONG) {
jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(zv)); jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(zv));
} else if (Z_TYPE_P(zv) == IS_STRING) { } else if (Z_TYPE_P(zv) == IS_STRING) {
jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(zv), 1); jump_zv = zend_hash_find_known_hash(jumptable, Z_STR_P(zv));
} }
} else { } else {
ZEND_UNREACHABLE(); ZEND_UNREACHABLE();
@ -13932,7 +13932,7 @@ static int zend_jit_in_array(dasm_State **Dst, const zend_op *opline, uint32_t o
} else { } else {
zend_string *str = Z_STR_P(RT_CONSTANT(opline, opline->op1)); zend_string *str = Z_STR_P(RT_CONSTANT(opline, opline->op1));
| LOAD_ADDR FCARG2x, str | LOAD_ADDR FCARG2x, str
| EXT_CALL _zend_hash_find_known_hash, REG0 | EXT_CALL zend_hash_find_known_hash, REG0
} }
if (exit_addr) { if (exit_addr) {
if (smart_branch_opcode == ZEND_JMPZ) { if (smart_branch_opcode == ZEND_JMPZ) {

View file

@ -63,7 +63,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_jit_init_func_run_tim
static zend_function* ZEND_FASTCALL zend_jit_find_func_helper(zend_string *name) static zend_function* ZEND_FASTCALL zend_jit_find_func_helper(zend_string *name)
{ {
zval *func = zend_hash_find_ex(EG(function_table), name, 1); zval *func = zend_hash_find_known_hash(EG(function_table), name);
zend_function *fbc; zend_function *fbc;
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
@ -78,11 +78,11 @@ static zend_function* ZEND_FASTCALL zend_jit_find_func_helper(zend_string *name)
static zend_function* ZEND_FASTCALL zend_jit_find_ns_func_helper(zval *func_name) static zend_function* ZEND_FASTCALL zend_jit_find_ns_func_helper(zval *func_name)
{ {
zval *func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name + 1), 1); zval *func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 1));
zend_function *fbc; zend_function *fbc;
if (func == NULL) { if (func == NULL) {
func = zend_hash_find_ex(EG(function_table), Z_STR_P(func_name + 2), 1); func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(func_name + 2));
if (UNEXPECTED(func == NULL)) { if (UNEXPECTED(func == NULL)) {
return NULL; return NULL;
} }
@ -262,7 +262,7 @@ static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw(HashTable *ht, zend_lon
static zval* ZEND_FASTCALL zend_jit_hash_lookup_rw(HashTable *ht, zend_string *str) static zval* ZEND_FASTCALL zend_jit_hash_lookup_rw(HashTable *ht, zend_string *str)
{ {
zval *retval = zend_hash_find_ex(ht, str, 1); zval *retval = zend_hash_find_known_hash(ht, str);
if (!retval) { if (!retval) {
/* Key may be released while throwing the undefined index warning. */ /* Key may be released while throwing the undefined index warning. */
retval = zend_undefined_index_write(ht, str); retval = zend_undefined_index_write(ht, str);
@ -1324,7 +1324,7 @@ static zend_reference* ZEND_FASTCALL zend_jit_fetch_global_helper(zend_string *v
} }
} }
value = zend_hash_find_ex(&EG(symbol_table), varname, 1); value = zend_hash_find_known_hash(&EG(symbol_table), varname);
if (UNEXPECTED(value == NULL)) { if (UNEXPECTED(value == NULL)) {
value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval)); value = zend_hash_add_new(&EG(symbol_table), varname, &EG(uninitialized_zval));
idx = (char*)value - (char*)EG(symbol_table).arData; idx = (char*)value - (char*)EG(symbol_table).arData;
@ -1423,7 +1423,7 @@ static void ZEND_FASTCALL zend_jit_fetch_obj_r_dynamic(zend_object *zobj, intptr
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
intptr_t idx = (char*)retval - (char*)zobj->properties->arData; intptr_t idx = (char*)retval - (char*)zobj->properties->arData;
@ -1481,7 +1481,7 @@ static void ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic(zend_object *zobj, intpt
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET); CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_DYNAMIC_PROPERTY_OFFSET);
} }
retval = zend_hash_find_ex(zobj->properties, name, 1); retval = zend_hash_find_known_hash(zobj->properties, name);
if (EXPECTED(retval)) { if (EXPECTED(retval)) {
intptr_t idx = (char*)retval - (char*)zobj->properties->arData; intptr_t idx = (char*)retval - (char*)zobj->properties->arData;

View file

@ -258,12 +258,12 @@ static zend_always_inline zend_constant* _zend_quick_get_constant(
zend_constant *c = NULL; zend_constant *c = NULL;
/* null/true/false are resolved during compilation, so don't check for them here. */ /* null/true/false are resolved during compilation, so don't check for them here. */
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1); zv = zend_hash_find_known_hash(EG(zend_constants), Z_STR_P(key));
if (zv) { if (zv) {
c = (zend_constant*)Z_PTR_P(zv); c = (zend_constant*)Z_PTR_P(zv);
} else if (flags & IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE) { } else if (flags & IS_CONSTANT_UNQUALIFIED_IN_NAMESPACE) {
key++; key++;
zv = zend_hash_find_ex(EG(zend_constants), Z_STR_P(key), 1); zv = zend_hash_find_known_hash(EG(zend_constants), Z_STR_P(key));
if (zv) { if (zv) {
c = (zend_constant*)Z_PTR_P(zv); c = (zend_constant*)Z_PTR_P(zv);
} }

View file

@ -5617,7 +5617,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o
| EXT_CALL zend_hash_find, r0 | EXT_CALL zend_hash_find, r0
|1: |1:
} else { } else {
| EXT_CALL _zend_hash_find_known_hash, r0 | EXT_CALL zend_hash_find_known_hash, r0
} }
| test r0, r0 | test r0, r0
if (not_found_exit_addr) { if (not_found_exit_addr) {
@ -5640,7 +5640,7 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o
| EXT_CALL zend_hash_find, r0 | EXT_CALL zend_hash_find, r0
|1: |1:
} else { } else {
| EXT_CALL _zend_hash_find_known_hash, r0 | EXT_CALL zend_hash_find_known_hash, r0
} }
| test r0, r0 | test r0, r0
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE && type == BP_VAR_R) { if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE && type == BP_VAR_R) {
@ -14139,13 +14139,13 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o
} }
} else if (opline->opcode == ZEND_SWITCH_STRING) { } else if (opline->opcode == ZEND_SWITCH_STRING) {
if (Z_TYPE_P(zv) == IS_STRING) { if (Z_TYPE_P(zv) == IS_STRING) {
jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(zv), 1); jump_zv = zend_hash_find_known_hash(jumptable, Z_STR_P(zv));
} }
} else if (opline->opcode == ZEND_MATCH) { } else if (opline->opcode == ZEND_MATCH) {
if (Z_TYPE_P(zv) == IS_LONG) { if (Z_TYPE_P(zv) == IS_LONG) {
jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(zv)); jump_zv = zend_hash_index_find(jumptable, Z_LVAL_P(zv));
} else if (Z_TYPE_P(zv) == IS_STRING) { } else if (Z_TYPE_P(zv) == IS_STRING) {
jump_zv = zend_hash_find_ex(jumptable, Z_STR_P(zv), 1); jump_zv = zend_hash_find_known_hash(jumptable, Z_STR_P(zv));
} }
} else { } else {
ZEND_UNREACHABLE(); ZEND_UNREACHABLE();
@ -14783,7 +14783,7 @@ static int zend_jit_in_array(dasm_State **Dst, const zend_op *opline, uint32_t o
} else { } else {
zend_string *str = Z_STR_P(RT_CONSTANT(opline, opline->op1)); zend_string *str = Z_STR_P(RT_CONSTANT(opline, opline->op1));
| LOAD_ADDR FCARG2a, str | LOAD_ADDR FCARG2a, str
| EXT_CALL _zend_hash_find_known_hash, r0 | EXT_CALL zend_hash_find_known_hash, r0
} }
| test r0, r0 | test r0, r0
if (exit_addr) { if (exit_addr) {

View file

@ -136,7 +136,7 @@ static void zend_accel_function_hash_copy(HashTable *target, HashTable *source)
for (; p != end; p++) { for (; p != end; p++) {
ZEND_ASSERT(Z_TYPE(p->val) != IS_UNDEF); ZEND_ASSERT(Z_TYPE(p->val) != IS_UNDEF);
ZEND_ASSERT(p->key); ZEND_ASSERT(p->key);
t = zend_hash_find_ex(target, p->key, 1); t = zend_hash_find_known_hash(target, p->key);
if (UNEXPECTED(t != NULL)) { if (UNEXPECTED(t != NULL)) {
goto failure; goto failure;
} }
@ -173,7 +173,7 @@ static void zend_accel_class_hash_copy(HashTable *target, HashTable *source)
for (; p != end; p++) { for (; p != end; p++) {
ZEND_ASSERT(Z_TYPE(p->val) != IS_UNDEF); ZEND_ASSERT(Z_TYPE(p->val) != IS_UNDEF);
ZEND_ASSERT(p->key); ZEND_ASSERT(p->key);
t = zend_hash_find_ex(target, p->key, 1); t = zend_hash_find_known_hash(target, p->key);
if (UNEXPECTED(t != NULL)) { if (UNEXPECTED(t != NULL)) {
if (EXPECTED(ZSTR_LEN(p->key) > 0) && EXPECTED(ZSTR_VAL(p->key)[0] == 0)) { if (EXPECTED(ZSTR_LEN(p->key) > 0) && EXPECTED(ZSTR_VAL(p->key)[0] == 0)) {
/* Runtime definition key. There are two circumstances under which the key can /* Runtime definition key. There are two circumstances under which the key can

View file

@ -5134,7 +5134,7 @@ ZEND_METHOD(ReflectionClass, getTraitAliases)
zend_string *lcname = zend_string_tolower(cur_ref->method_name); zend_string *lcname = zend_string_tolower(cur_ref->method_name);
for (j = 0; j < ce->num_traits; j++) { for (j = 0; j < ce->num_traits; j++) {
zv = zend_hash_find_ex(CG(class_table), ce->trait_names[j].lc_name, 1); zv = zend_hash_find_known_hash(CG(class_table), ce->trait_names[j].lc_name);
if (zv) { if (zv) {
trait = Z_CE_P(zv); trait = Z_CE_P(zv);
if (zend_hash_exists(&trait->function_table, lcname)) { if (zend_hash_exists(&trait->function_table, lcname)) {

View file

@ -1671,7 +1671,7 @@ static zend_long php_extract_ref_if_exists(zend_array *arr, zend_array *symbol_t
if (!var_name) { if (!var_name) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -1714,7 +1714,7 @@ static zend_long php_extract_if_exists(zend_array *arr, zend_array *symbol_table
if (!var_name) { if (!var_name) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -1762,7 +1762,7 @@ static zend_long php_extract_ref_overwrite(zend_array *arr, zend_array *symbol_t
zend_throw_error(NULL, "Cannot re-assign $this"); zend_throw_error(NULL, "Cannot re-assign $this");
return -1; return -1;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -1809,7 +1809,7 @@ static zend_long php_extract_overwrite(zend_array *arr, zend_array *symbol_table
zend_throw_error(NULL, "Cannot re-assign $this"); zend_throw_error(NULL, "Cannot re-assign $this");
return -1; return -1;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -1844,7 +1844,7 @@ static zend_long php_extract_ref_prefix_if_exists(zend_array *arr, zend_array *s
if (!var_name) { if (!var_name) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -1900,7 +1900,7 @@ static zend_long php_extract_prefix_if_exists(zend_array *arr, zend_array *symbo
if (!var_name) { if (!var_name) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -1954,7 +1954,7 @@ static zend_long php_extract_ref_prefix_same(zend_array *arr, zend_array *symbol
if (ZSTR_LEN(var_name) == 0) { if (ZSTR_LEN(var_name) == 0) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -2028,7 +2028,7 @@ static zend_long php_extract_prefix_same(zend_array *arr, zend_array *symbol_tab
if (ZSTR_LEN(var_name) == 0) { if (ZSTR_LEN(var_name) == 0) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -2301,7 +2301,7 @@ static zend_long php_extract_ref_skip(zend_array *arr, zend_array *symbol_table)
if (zend_string_equals_literal(var_name, "this")) { if (zend_string_equals_literal(var_name, "this")) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -2346,7 +2346,7 @@ static zend_long php_extract_skip(zend_array *arr, zend_array *symbol_table) /*
if (zend_string_equals_literal(var_name, "this")) { if (zend_string_equals_literal(var_name, "this")) {
continue; continue;
} }
orig_var = zend_hash_find_ex(symbol_table, var_name, 1); orig_var = zend_hash_find_known_hash(symbol_table, var_name);
if (orig_var) { if (orig_var) {
if (Z_TYPE_P(orig_var) == IS_INDIRECT) { if (Z_TYPE_P(orig_var) == IS_INDIRECT) {
orig_var = Z_INDIRECT_P(orig_var); orig_var = Z_INDIRECT_P(orig_var);
@ -3509,7 +3509,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
ZEND_HASH_FOREACH_STR_KEY_VAL(src, string_key, src_entry) { ZEND_HASH_FOREACH_STR_KEY_VAL(src, string_key, src_entry) {
if (string_key) { if (string_key) {
if ((dest_entry = zend_hash_find_ex(dest, string_key, 1)) != NULL) { if ((dest_entry = zend_hash_find_known_hash(dest, string_key)) != NULL) {
zval *src_zval = src_entry; zval *src_zval = src_entry;
zval *dest_zval = dest_entry; zval *dest_zval = dest_entry;
HashTable *thash; HashTable *thash;
@ -3616,7 +3616,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ *
ZVAL_DEREF(src_zval); ZVAL_DEREF(src_zval);
if (string_key) { if (string_key) {
if (Z_TYPE_P(src_zval) != IS_ARRAY || if (Z_TYPE_P(src_zval) != IS_ARRAY ||
(dest_entry = zend_hash_find_ex(dest, string_key, 1)) == NULL || (dest_entry = zend_hash_find_known_hash(dest, string_key)) == NULL ||
(Z_TYPE_P(dest_entry) != IS_ARRAY && (Z_TYPE_P(dest_entry) != IS_ARRAY &&
(!Z_ISREF_P(dest_entry) || Z_TYPE_P(Z_REFVAL_P(dest_entry)) != IS_ARRAY))) { (!Z_ISREF_P(dest_entry) || Z_TYPE_P(Z_REFVAL_P(dest_entry)) != IS_ARRAY))) {
@ -4564,7 +4564,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa
} else { } else {
ok = 1; ok = 1;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if ((data = zend_hash_find_ex(Z_ARRVAL(args[i]), key, 1)) == NULL || if ((data = zend_hash_find_known_hash(Z_ARRVAL(args[i]), key)) == NULL ||
(intersect_data_compare_func && (intersect_data_compare_func &&
intersect_data_compare_func(val, data) != 0) intersect_data_compare_func(val, data) != 0)
) { ) {
@ -4938,7 +4938,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty
} else { } else {
ok = 1; ok = 1;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if ((data = zend_hash_find_ex(Z_ARRVAL(args[i]), key, 1)) != NULL && if ((data = zend_hash_find_known_hash(Z_ARRVAL(args[i]), key)) != NULL &&
(!diff_data_compare_func || (!diff_data_compare_func ||
diff_data_compare_func(val, data) == 0) diff_data_compare_func(val, data) == 0)
) { ) {

View file

@ -1164,7 +1164,7 @@ again:
} }
if (ce != PHP_IC_ENTRY) { if (ce != PHP_IC_ENTRY) {
zval *zv = zend_hash_find_ex(&ce->function_table, ZSTR_KNOWN(ZEND_STR_SLEEP), 1); zval *zv = zend_hash_find_known_hash(&ce->function_table, ZSTR_KNOWN(ZEND_STR_SLEEP));
if (zv) { if (zv) {
HashTable *ht; HashTable *ht;