Better hot/cold code splitting

This commit is contained in:
Dmitry Stogov 2019-05-31 12:09:06 +03:00
parent 84333cad67
commit 1df9f238fe
7 changed files with 63 additions and 52 deletions

View file

@ -530,12 +530,24 @@ ZEND_API void zend_attach_symbol_table(zend_execute_data *execute_data);
ZEND_API void zend_detach_symbol_table(zend_execute_data *execute_data);
ZEND_API int zend_set_local_var(zend_string *name, zval *value, int force);
ZEND_API int zend_set_local_var_str(const char *name, size_t len, zval *value, int force);
ZEND_API int zend_forbid_dynamic_call(const char *func_name);
static zend_always_inline int zend_forbid_dynamic_call(const char *func_name)
{
zend_execute_data *ex = EG(current_execute_data);
ZEND_ASSERT(ex != NULL && ex->func != NULL);
if (ZEND_CALL_INFO(ex) & ZEND_CALL_DYNAMIC) {
zend_error(E_WARNING, "Cannot call %s dynamically", func_name);
return FAILURE;
}
return SUCCESS;
}
ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name);
ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
ZEND_API const char *zend_get_object_type(const zend_class_entry *ce);
ZEND_API ZEND_COLD const char *zend_get_object_type(const zend_class_entry *ce);
ZEND_API zend_bool zend_is_iterable(zval *iterable);