diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-06-25 19:53:58 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-06-25 19:53:58 +0300 |
commit | 7f67513ca3c71c0d84a272d1572101ef45203b30 (patch) | |
tree | 190db98954e4fdb1b8b9ae3591783dcbbb73b6c8 /Zend/zend_API.c | |
parent | 30f79977621051d002d6b153bf6ab1525c2a028c (diff) | |
download | php-git-7f67513ca3c71c0d84a272d1572101ef45203b30.tar.gz |
Lazy function copying from op_cache SHM into process memory
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index c95ce058a4..777361d41b 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3007,6 +3007,7 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval fcc->calling_scope = NULL; if (!ce_org) { + zend_function *func; zend_string *lmname; /* Check if function with given name exists. @@ -3015,20 +3016,20 @@ static zend_always_inline int zend_is_callable_check_func(int check_flags, zval /* Skip leading \ */ ZSTR_ALLOCA_ALLOC(lmname, Z_STRLEN_P(callable) - 1, use_heap); zend_str_tolower_copy(ZSTR_VAL(lmname), Z_STRVAL_P(callable) + 1, Z_STRLEN_P(callable)); - zv = zend_hash_find(EG(function_table), lmname); + func = zend_fetch_function(lmname); ZSTR_ALLOCA_FREE(lmname, use_heap); } else { lmname = Z_STR_P(callable); - zv = zend_hash_find(EG(function_table), lmname); - if (!zv) { + func = zend_fetch_function(lmname); + if (!func) { ZSTR_ALLOCA_ALLOC(lmname, Z_STRLEN_P(callable), use_heap); zend_str_tolower_copy(ZSTR_VAL(lmname), Z_STRVAL_P(callable), Z_STRLEN_P(callable)); - zv = zend_hash_find(EG(function_table), lmname); + func = zend_fetch_function(lmname); ZSTR_ALLOCA_FREE(lmname, use_heap); } } - if (EXPECTED(zv != NULL)) { - fcc->function_handler = Z_PTR_P(zv); + if (EXPECTED(func != NULL)) { + fcc->function_handler = func; return 1; } } |