Skip to content

Commit 525296a

Browse files
committed
zend_object_handler.c: call zend_get_call_trampoline_func() directly
Abstracting away the bool parameter is not that useful, and doesn't make the code more legible. So just get rid of them and call the function with the boolean parameter directly.
1 parent 275ec6f commit 525296a

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

Zend/zend_object_handlers.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,12 +1826,6 @@ ZEND_API zend_function *zend_get_property_hook_trampoline(
18261826
return func;
18271827
}
18281828

1829-
static zend_always_inline zend_function *zend_get_user_call_function(zend_class_entry *ce, zend_string *method_name) /* {{{ */
1830-
{
1831-
return zend_get_call_trampoline_func(ce, method_name, false);
1832-
}
1833-
/* }}} */
1834-
18351829
ZEND_API ZEND_COLD zend_never_inline void zend_bad_method_call(const zend_function *fbc, const zend_string *method_name, const zend_class_entry *scope) /* {{{ */
18361830
{
18371831
zend_throw_error(NULL, "Call to %s method %s::%s() from %s%s",
@@ -1873,7 +1867,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *
18731867
ZSTR_ALLOCA_FREE(lc_method_name, use_heap);
18741868
}
18751869
if (zobj->ce->__call) {
1876-
return zend_get_user_call_function(zobj->ce, method_name);
1870+
return zend_get_call_trampoline_func(zobj->ce, method_name, false);
18771871
} else {
18781872
return NULL;
18791873
}
@@ -1899,7 +1893,7 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *
18991893
if (UNEXPECTED(fbc->op_array.fn_flags & ZEND_ACC_PRIVATE)
19001894
|| UNEXPECTED(!zend_check_protected(zend_get_function_root_class(fbc), scope))) {
19011895
if (zobj->ce->__call) {
1902-
fbc = zend_get_user_call_function(zobj->ce, method_name);
1896+
fbc = zend_get_call_trampoline_func(zobj->ce, method_name, false);
19031897
} else {
19041898
zend_bad_method_call(fbc, method_name, scope);
19051899
fbc = NULL;
@@ -1920,14 +1914,8 @@ ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *
19201914
}
19211915
/* }}} */
19221916

1923-
static zend_always_inline zend_function *zend_get_user_callstatic_function(zend_class_entry *ce, zend_string *method_name) /* {{{ */
1924-
{
1925-
return zend_get_call_trampoline_func(ce, method_name, true);
1926-
}
1927-
/* }}} */
1928-
19291917
static zend_always_inline zend_function *get_static_method_fallback(
1930-
zend_class_entry *ce, zend_string *function_name)
1918+
const zend_class_entry *ce, zend_string *function_name)
19311919
{
19321920
zend_object *object;
19331921
if (ce->__call &&
@@ -1937,9 +1925,9 @@ static zend_always_inline zend_function *get_static_method_fallback(
19371925
* see: tests/classes/__call_004.phpt */
19381926

19391927
ZEND_ASSERT(object->ce->__call);
1940-
return zend_get_user_call_function(object->ce, function_name);
1928+
return zend_get_call_trampoline_func(object->ce, function_name, false);
19411929
} else if (ce->__callstatic) {
1942-
return zend_get_user_callstatic_function(ce, function_name);
1930+
return zend_get_call_trampoline_func(ce, function_name, true);
19431931
} else {
19441932
return NULL;
19451933
}

0 commit comments

Comments
 (0)