Skip to content

Commit 6debe4e

Browse files
committed
Do quick lookup
1 parent 0ad7a8a commit 6debe4e

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

Zend/zend_vm_def.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3757,13 +3757,19 @@ ZEND_VM_HOT_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST, NUM|CACHE_SLOT)
37573757
fbc = CACHED_PTR(opline->result.num);
37583758
if (UNEXPECTED(fbc == NULL)) {
37593759
zval *function_name = (zval*)RT_CONSTANT(opline, opline->op2);
3760+
/* Perform quick look-up of function */
37603761
/* Fetch lowercase name stored in the next literal slot */
3761-
fbc = zend_lookup_function_ex(Z_STR_P(function_name), Z_STR_P(function_name+1), /* use_autoload */ true);
3762-
if (UNEXPECTED(fbc == NULL)) {
3763-
if (EXPECTED(!EG(exception))) {
3764-
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
3762+
zval *func = zend_hash_find_known_hash(EG(function_table), Z_STR_P(function_name+1));
3763+
if (UNEXPECTED(func == NULL)) {
3764+
fbc = zend_lookup_function_ex(Z_STR_P(function_name), Z_STR_P(function_name+1), /* use_autoload */ true);
3765+
if (UNEXPECTED(fbc == NULL)) {
3766+
if (EXPECTED(!EG(exception))) {
3767+
ZEND_VM_DISPATCH_TO_HELPER(zend_undefined_function_helper);
3768+
}
3769+
HANDLE_EXCEPTION();
37653770
}
3766-
HANDLE_EXCEPTION();
3771+
} else {
3772+
fbc = Z_FUNC_P(func);
37673773
}
37683774
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
37693775
init_func_run_time_cache(&fbc->op_array);

Zend/zend_vm_execute.h

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)