]> granicus.if.org Git - php/commitdiff
Mark "cold" functions
authorDmitry Stogov <dmitry@zend.com>
Wed, 29 May 2019 08:31:46 +0000 (11:31 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 29 May 2019 08:48:41 +0000 (11:48 +0300)
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_closures.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_ini.h
Zend/zend_object_handlers.c

index a56231e7c83beabc94b6ed278dc74e880fbeca30..1034d8410bceeba909ef9e061262886b972e3825 100644 (file)
@@ -2757,7 +2757,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_lengt
 
 /* Disabled functions support */
 
-zend_op_array *display_disabled_compile_string(zval *source_string, char *filename)
+static ZEND_COLD zend_op_array *display_disabled_compile_string(zval *source_string, char *filename)
 {
        zend_error(E_WARNING, "eval() has been disabled for security reasons");
        return NULL;
@@ -2765,7 +2765,7 @@ zend_op_array *display_disabled_compile_string(zval *source_string, char *filena
 
 /* {{{ proto void display_disabled_function(void)
 Dummy function which displays an error when a disabled function is called. */
-ZEND_API ZEND_FUNCTION(display_disabled_function)
+ZEND_API ZEND_COLD ZEND_FUNCTION(display_disabled_function)
 {
        zend_error(E_WARNING, "%s() has been disabled for security reasons", get_active_function_name());
 }
@@ -2794,7 +2794,7 @@ ZEND_API int zend_disable_function(char *function_name, size_t function_name_len
 #ifdef ZEND_WIN32
 #pragma optimize("", off)
 #endif
-static zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{ */
+static ZEND_COLD zend_object *display_disabled_class(zend_class_entry *class_type) /* {{{ */
 {
        zend_object *intern;
 
index aa11246d07038a3610f76cefdb0fcb1c69c31516..bdf3b1ce2b2751e53e265902161d41ab3375cba0 100644 (file)
@@ -542,7 +542,6 @@ ZEND_API zend_bool zend_is_iterable(zval *iterable);
 ZEND_API zend_bool zend_is_countable(zval *countable);
 
 ZEND_API ZEND_FUNCTION(display_disabled_function);
-ZEND_API ZEND_FUNCTION(display_disabled_class);
 END_EXTERN_C()
 
 #if ZEND_DEBUG
index 7aaee192b7dc77f33300ae45e16dca59a056fe1d..e8688a6fd1ac0707dc75a9a14f3316f6d49cefc8 100644 (file)
@@ -412,28 +412,28 @@ static zend_function *zend_closure_get_method(zend_object **object, zend_string
 }
 /* }}} */
 
-static zval *zend_closure_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
+static ZEND_COLD zval *zend_closure_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
 {
        ZEND_CLOSURE_PROPERTY_ERROR();
        return &EG(uninitialized_zval);
 }
 /* }}} */
 
-static zval *zend_closure_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
+static ZEND_COLD zval *zend_closure_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
 {
        ZEND_CLOSURE_PROPERTY_ERROR();
        return value;
 }
 /* }}} */
 
-static zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
+static ZEND_COLD zval *zend_closure_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) /* {{{ */
 {
        ZEND_CLOSURE_PROPERTY_ERROR();
        return NULL;
 }
 /* }}} */
 
-static int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
+static ZEND_COLD int zend_closure_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
 {
        if (has_set_exists != ZEND_PROPERTY_EXISTS) {
                ZEND_CLOSURE_PROPERTY_ERROR();
@@ -442,7 +442,7 @@ static int zend_closure_has_property(zval *object, zval *member, int has_set_exi
 }
 /* }}} */
 
-static void zend_closure_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
+static ZEND_COLD void zend_closure_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
 {
        ZEND_CLOSURE_PROPERTY_ERROR();
 }
index 869a04fc6e7a176cf931ed4b7e1fdb9b358ae12f..494a5c999da05fd14eb0d45394cdb3f6e0148a07 100644 (file)
@@ -171,7 +171,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
 
 ZEND_API int zval_update_constant(zval *pp);
 ZEND_API int zval_update_constant_ex(zval *pp, zend_class_entry *scope);
-ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result);
+ZEND_API ZEND_COLD int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result);
 
 /* dedicated Zend executor functions - do not use! */
 struct _zend_vm_stack {
index 575f2851671838ad8bf1cd99f866cad522a0aff3..478d902a0b7a9aa0fbe653998d51f4d2060a772d 100644 (file)
@@ -212,7 +212,7 @@ static void zend_unclean_zval_ptr_dtor(zval *zv) /* {{{ */
 }
 /* }}} */
 
-static void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
+static ZEND_COLD void zend_throw_or_error(int fetch_type, zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
 {
        va_list va;
        char *message = NULL;
@@ -564,7 +564,7 @@ ZEND_API zend_bool zend_is_executing(void) /* {{{ */
 }
 /* }}} */
 
-ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
+ZEND_API ZEND_COLD int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
 {
        char *colon;
 
index 0b7f1480836c580398e3a49ed957cb4a4588dde6..596444880ac962932d90022cb6add46df34c0623 100644 (file)
@@ -26,7 +26,7 @@
 #define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
 
 #define ZEND_INI_MH(name) int name(zend_ini_entry *entry, zend_string *new_value, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
-#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
+#define ZEND_INI_DISP(name) ZEND_COLD void name(zend_ini_entry *ini_entry, int type)
 
 typedef struct _zend_ini_entry_def {
        const char *name;
index 2c1d5ec555e0a5ecc8b12a9fe93b8f9a13ffb8d3..41042941c7558b334606b479bd433fb1f9310dc6 100644 (file)
@@ -466,7 +466,7 @@ found:
 }
 /* }}} */
 
-static zend_never_inline void zend_wrong_offset(zend_class_entry *ce, zend_string *member) /* {{{ */
+static ZEND_COLD void zend_wrong_offset(zend_class_entry *ce, zend_string *member) /* {{{ */
 {
        zend_property_info *dummy;