]> granicus.if.org Git - php/commitdiff
Mark error and exception functions as "cold" (Matt's idea)
authorDmitry Stogov <dmitry@zend.com>
Wed, 19 Aug 2015 11:40:56 +0000 (14:40 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 19 Aug 2015 11:40:56 +0000 (14:40 +0300)
14 files changed:
Zend/zend.c
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_alloc.c
Zend/zend_closures.c
Zend/zend_exceptions.c
Zend/zend_exceptions.h
Zend/zend_execute.c
Zend/zend_generators.c
Zend/zend_inheritance.c
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h
Zend/zend_portability.h

index 4a39c7fc01cb5288f37c7ad928101ba13b5d2ade..d9f29ab0ff533a27c06a176c3fcf869b54454574 100644 (file)
@@ -880,7 +880,7 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
 /* }}} */
 
 /* this should be compatible with the standard zenderror */
-void zenderror(const char *error) /* {{{ */
+ZEND_COLD void zenderror(const char *error) /* {{{ */
 {
        if (EG(exception)) {
                /* An exception was thrown in the lexer, don't throw another in the parser. */
@@ -892,7 +892,7 @@ void zenderror(const char *error) /* {{{ */
 /* }}} */
 
 BEGIN_EXTERN_C()
-ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
+ZEND_API ZEND_COLD void _zend_bailout(char *filename, uint lineno) /* {{{ */
 {
 
        if (!EG(bailout)) {
@@ -1032,9 +1032,9 @@ ZEND_API zval *zend_get_configuration_directive(zend_string *name) /* {{{ */
        } while (0)
 
 #if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS)
-ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) /* {{{ */
 #else
-static void zend_error_va_list(int type, const char *format, va_list args)
+static ZEND_COLD void zend_error_va_list(int type, const char *format, va_list args)
 #endif
 {
        char *str;
@@ -1274,9 +1274,9 @@ static void zend_error_va_list(int type, const char *format, va_list args)
 
 #ifdef HAVE_NORETURN
 # ifdef HAVE_NORETURN_ALIAS
-void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn));
+ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((alias("zend_error"),noreturn));
 # else
-ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) /* {{{ */
 {
        va_list va;
 
@@ -1285,7 +1285,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
        va_end(va);
 }
 
-ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
+ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...)
 {
        va_list va;
 
@@ -1297,7 +1297,7 @@ ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ..
 # endif
 #endif
 
-ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
 {
        va_list va;
        char *message = NULL;
@@ -1326,7 +1326,7 @@ ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *forma
 }
 /* }}} */
 
-ZEND_API void zend_type_error(const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) /* {{{ */
 {
        va_list va;
        char *message = NULL;
@@ -1338,7 +1338,7 @@ ZEND_API void zend_type_error(const char *format, ...) /* {{{ */
        va_end(va);
 } /* }}} */
 
-ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
 {
        va_list va;
        char *message = NULL;
@@ -1355,7 +1355,7 @@ ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *fo
        va_end(va);
 } /* }}} */
 
-ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
 {
 #if ZEND_DEBUG
        va_list args;
index 2d90424208a56c1cf26475185e74ef3219aabf04..c4f1a23a59afef75fed421323b79905c94a3c620 100644 (file)
@@ -78,9 +78,9 @@ ZEND_TSRMLS_CACHE_EXTERN();
 
 #ifdef HAVE_NORETURN
 # ifdef ZEND_NORETRUN_ALIAS
-void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
+ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
 # else
-ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
+ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
 # endif
 #else
 # define zend_error_noreturn zend_error
@@ -240,7 +240,7 @@ void zend_register_standard_ini_entries(void);
 void zend_post_startup(void);
 void zend_set_utility_values(zend_utility_values *utility_values);
 
-ZEND_API void _zend_bailout(char *filename, uint lineno);
+ZEND_API ZEND_COLD void _zend_bailout(char *filename, uint lineno);
 
 ZEND_API char *get_zend_version(void);
 ZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy);
@@ -249,7 +249,7 @@ ZEND_API size_t zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int
 ZEND_API void zend_print_zval_r(zval *expr, int indent);
 ZEND_API void zend_print_flat_zval_r(zval *expr);
 ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent);
-ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
 
 ZEND_API void zend_activate(void);
 ZEND_API void zend_deactivate(void);
@@ -284,10 +284,10 @@ extern zend_string *(*zend_vstrpprintf)(size_t max_len, const char *format, va_l
 extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
 extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);
 
-ZEND_API void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
-ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
-ZEND_API void zend_type_error(const char *format, ...);
-ZEND_API void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
+ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
+ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
+ZEND_API ZEND_COLD void zend_type_error(const char *format, ...);
+ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
 
 void zenderror(const char *error);
 
index 559a1d289b77d1fbb30c443c992e182284e593b3..133109f300e90551003d64c6bda89aedd59bb461 100644 (file)
@@ -149,7 +149,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array) /
 }
 /* }}} */
 
-ZEND_API void zend_wrong_param_count(void) /* {{{ */
+ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
 {
        const char *space;
        const char *class_name = get_active_class_name(&space);
@@ -196,7 +196,7 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
 /* }}} */
 
 #ifdef FAST_ZPP
-ZEND_API void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
 {
        zend_function *active_function = EG(current_execute_data)->func;
        const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
@@ -212,7 +212,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int mi
 }
 /* }}} */
 
-ZEND_API void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
 {
        const char *space;
        const char *class_name = get_active_class_name(&space);
@@ -226,7 +226,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected
 }
 /* }}} */
 
-ZEND_API void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg) /* {{{ */
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg) /* {{{ */
 {
        const char *space;
        const char *class_name = get_active_class_name(&space);
@@ -236,7 +236,7 @@ ZEND_API void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name,
 }
 /* }}} */
 
-ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error) /* {{{ */
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error) /* {{{ */
 {
        const char *space;
        const char *class_name = get_active_class_name(&space);
@@ -790,7 +790,7 @@ ZEND_API int zend_parse_parameter(int flags, int arg_num, zval *arg, const char
        return ret;
 }
 
-static void zend_parse_parameters_debug_error(const char *msg) {
+static ZEND_COLD void zend_parse_parameters_debug_error(const char *msg) {
        zend_function *active_function = EG(current_execute_data)->func;
        const char *class_name = active_function->common.scope
                ? ZSTR_VAL(active_function->common.scope->name) : "";
index 0fc05848f2f9e1890e17e5365d3e20ca2e657148..66a5cb637d6a14715139990e05143bac5c1ec0a4 100644 (file)
@@ -300,7 +300,7 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen
 ZEND_API int zend_disable_function(char *function_name, size_t function_name_length);
 ZEND_API int zend_disable_class(char *class_name, size_t class_name_length);
 
-ZEND_API void zend_wrong_param_count(void);
+ZEND_API ZEND_COLD void zend_wrong_param_count(void);
 
 #define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
 #define IS_CALLABLE_CHECK_NO_ACCESS   (1<<1)
@@ -691,10 +691,10 @@ typedef enum _zend_expected_type {
        Z_EXPECTED_LAST
 } zend_expected_type;
 
-ZEND_API void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args);
-ZEND_API void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg);
-ZEND_API void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg);
-ZEND_API void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramers_count_error(int num_args, int min_num_args, int max_num_args);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_type_error(int num, zend_expected_type expected_type, zval *arg);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_paramer_class_error(int num, char *name, zval *arg);
+ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, int num, char *error);
 
 #define ZPP_ERROR_OK             0
 #define ZPP_ERROR_FAILURE        1
index 52b1ac5868e6eab42494579b5f152cab7106eb2b..493cf1f728de884681b391e8a7f11acc624dd48b 100644 (file)
@@ -338,7 +338,7 @@ static const int bin_pages[] = {
 };
 
 #if ZEND_DEBUG
-void zend_debug_alloc_output(char *format, ...)
+ZEND_COLD void zend_debug_alloc_output(char *format, ...)
 {
        char output_buf[256];
        va_list args;
@@ -355,7 +355,7 @@ void zend_debug_alloc_output(char *format, ...)
 }
 #endif
 
-static ZEND_NORETURN void zend_mm_panic(const char *message)
+static ZEND_COLD ZEND_NORETURN void zend_mm_panic(const char *message)
 {
        fprintf(stderr, "%s\n", message);
 /* See http://support.microsoft.com/kb/190351 */
@@ -368,7 +368,7 @@ static ZEND_NORETURN void zend_mm_panic(const char *message)
        exit(1);
 }
 
-static ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
+static ZEND_COLD ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
        const char *format,
        size_t limit,
 #if ZEND_DEBUG
index 6f16935cc7147b4ac274051b96d995850faba929..637e2dd5fc9783606042845c58bf9b000a2c205c 100644 (file)
@@ -205,7 +205,7 @@ ZEND_METHOD(Closure, bind)
 }
 /* }}} */
 
-static zend_function *zend_closure_get_constructor(zend_object *object) /* {{{ */
+static ZEND_COLD zend_function *zend_closure_get_constructor(zend_object *object) /* {{{ */
 {
        zend_throw_error(NULL, "Instantiation of 'Closure' is not allowed");
        return NULL;
@@ -448,7 +448,7 @@ static HashTable *zend_closure_get_gc(zval *obj, zval **table, int *n) /* {{{ */
 
 /* {{{ proto Closure::__construct()
    Private constructor preventing instantiation */
-ZEND_METHOD(Closure, __construct)
+ZEND_COLD ZEND_METHOD(Closure, __construct)
 {
        zend_throw_error(NULL, "Instantiation of 'Closure' is not allowed");
 }
index e38c4140fac5a9dbf8a1dea939b93e2bb9218b0f..002f519bc6e38e9623c8017607f88052d88871fd 100644 (file)
@@ -120,7 +120,7 @@ void zend_exception_restore(void) /* {{{ */
 }
 /* }}} */
 
-ZEND_API void zend_throw_exception_internal(zval *exception) /* {{{ */
+ZEND_API ZEND_COLD void zend_throw_exception_internal(zval *exception) /* {{{ */
 {
 #ifdef HAVE_DTRACE
        if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
@@ -233,7 +233,7 @@ static zend_object *zend_error_exception_new(zend_class_entry *class_type) /* {{
 
 /* {{{ proto Exception|Error Exception|Error::__clone()
    Clone the exception object */
-ZEND_METHOD(exception, __clone)
+ZEND_COLD ZEND_METHOD(exception, __clone)
 {
        /* Should never be executable */
        zend_throw_exception(NULL, "Cannot clone object using __clone()", 0);
@@ -908,7 +908,7 @@ ZEND_API zend_class_entry *zend_get_error_exception(void)
 }
 /* }}} */
 
-ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code) /* {{{ */
+ZEND_API ZEND_COLD zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code) /* {{{ */
 {
        zval ex;
 
@@ -935,7 +935,7 @@ ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const
 }
 /* }}} */
 
-ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) /* {{{ */
+ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) /* {{{ */
 {
        va_list arg;
        char *message;
@@ -950,7 +950,7 @@ ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, ze
 }
 /* }}} */
 
-ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity) /* {{{ */
+ZEND_API ZEND_COLD zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity) /* {{{ */
 {
        zval ex;
        zend_object *obj = zend_throw_exception(exception_ce, message, code);
@@ -980,7 +980,7 @@ static void zend_error_helper(int type, const char *filename, const uint lineno,
 }
 
 /* This function doesn't return if it uses E_ERROR */
-ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
+ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {{{ */
 {
        zval exception, rv;
        zend_class_entry *ce_exception;
@@ -1048,7 +1048,7 @@ ZEND_API void zend_exception_error(zend_object *ex, int severity) /* {{{ */
 }
 /* }}} */
 
-ZEND_API void zend_throw_exception_object(zval *exception) /* {{{ */
+ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception) /* {{{ */
 {
        zend_class_entry *exception_ce;
 
index f9bf24b4c2b07db28bf7399aab2340ae9f31141a..9b8d0d9e762c97bd4f88162b0b2fc4c555385aaa 100644 (file)
@@ -39,7 +39,7 @@ ZEND_API void zend_exception_set_previous(zend_object *exception, zend_object *a
 ZEND_API void zend_exception_save(void);
 ZEND_API void zend_exception_restore(void);
 
-ZEND_API void zend_throw_exception_internal(zval *exception);
+ZEND_API ZEND_COLD void zend_throw_exception_internal(zval *exception);
 
 void zend_register_default_exception(void);
 
@@ -55,9 +55,9 @@ ZEND_API void zend_register_default_classes(void);
 
 /* exception_ce   NULL, zend_ce_exception, zend_ce_error, or a derived class
  * message        NULL or the message of the exception */
-ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
-ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...);
-ZEND_API void zend_throw_exception_object(zval *exception);
+ZEND_API ZEND_COLD zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
+ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...);
+ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception);
 ZEND_API void zend_clear_exception(void);
 
 ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity);
@@ -65,7 +65,7 @@ ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce,
 extern ZEND_API void (*zend_throw_exception_hook)(zval *ex);
 
 /* show an exception using zend_error(severity,...), severity should be E_ERROR */
-ZEND_API void zend_exception_error(zend_object *exception, int severity);
+ZEND_API ZEND_COLD void zend_exception_error(zend_object *exception, int severity);
 
 /* do not export, in php it's available thru spprintf directly */
 size_t zend_spprintf(char **message, size_t max_len, const char *format, ...);
index c443fe49614aeb468f654216b4e8b1516b166f94..59f936d2a374245f47082e243b1a96713d7a3d1d 100644 (file)
@@ -585,7 +585,7 @@ static zend_always_inline zend_class_entry* zend_verify_arg_class_kind(const zen
        return zend_fetch_class(cur_arg_info->class_name, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
 }
 
-static void zend_verify_arg_error(const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg)
+static ZEND_COLD void zend_verify_arg_error(const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg)
 {
        zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
        const char *fname = ZSTR_VAL(zf->common.function_name);
@@ -846,10 +846,10 @@ static zend_always_inline int zend_verify_missing_arg_type(zend_function *zf, ui
        return 1;
 }
 
-static zend_always_inline int zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
+static ZEND_COLD int zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num, void **cache_slot)
 {
        if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||
-           zend_verify_missing_arg_type(EX(func), arg_num, cache_slot)) {
+           UNEXPECTED(zend_verify_missing_arg_type(EX(func), arg_num, cache_slot))) {
                const char *class_name = EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "";
                const char *space = EX(func)->common.scope ? "::" : "";
                const char *func_name = EX(func)->common.function_name ? ZSTR_VAL(EX(func)->common.function_name) : "main";
@@ -865,7 +865,7 @@ static zend_always_inline int zend_verify_missing_arg(zend_execute_data *execute
        return 0;
 }
 
-static void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
+static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
 {
        const char *fname = ZSTR_VAL(zf->common.function_name);
        const char *fsep;
@@ -889,7 +889,7 @@ static void zend_verify_return_error(const zend_function *zf, const char *need_m
        }
 }
 
-static void zend_verify_internal_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
+static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
 {
        const char *fname = ZSTR_VAL(zf->common.function_name);
        const char *fsep;
@@ -1003,7 +1003,7 @@ static zend_always_inline void zend_verify_return_type(zend_function *zf, zval *
        }
 }
 
-static zend_always_inline int zend_verify_missing_return_type(zend_function *zf, void **cache_slot)
+static ZEND_COLD int zend_verify_missing_return_type(zend_function *zf, void **cache_slot)
 {
        zend_arg_info *ret_info = zf->common.arg_info - 1;
        char *need_msg;
index 9ca264b97e4afddf171e8c75a83296ac4d2977c9..0b542921599a49b66d4a9c310c635d5ad00be3b7 100644 (file)
@@ -263,7 +263,7 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
 }
 /* }}} */
 
-static zend_function *zend_generator_get_constructor(zend_object *object) /* {{{ */
+static ZEND_COLD zend_function *zend_generator_get_constructor(zend_object *object) /* {{{ */
 {
        zend_throw_error(NULL, "The \"Generator\" class is reserved for internal use and cannot be manually instantiated");
 
index 3ccade9d0e1a6671201101f14143c9ea0eec0bc8..0d02bf7797cbb3d99d442d664bb0f22f037580a0 100644 (file)
@@ -345,7 +345,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
 }
 /* }}} */
 
-static void zend_append_type_hint(smart_str *str, const zend_function *fptr, zend_arg_info *arg_info, int return_hint) /* {{{ */
+static ZEND_COLD void zend_append_type_hint(smart_str *str, const zend_function *fptr, zend_arg_info *arg_info, int return_hint) /* {{{ */
 {
        if (arg_info->class_name) {
                const char *class_name;
@@ -387,7 +387,7 @@ static void zend_append_type_hint(smart_str *str, const zend_function *fptr, zen
 }
 /* }}} */
 
-static zend_string *zend_get_function_declaration(const zend_function *fptr) /* {{{ */
+static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function *fptr) /* {{{ */
 {
        smart_str str = {0};
 
index 43a010c07d5efe536918c2ec301c2c5e2f9d8af6..1c06f1ea5e90f7352d9e3c9d2e0ee7a8d2358d99 100644 (file)
@@ -1300,7 +1300,7 @@ undeclared_property:
 }
 /* }}} */
 
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name) /* {{{ */
+ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name) /* {{{ */
 {
        zend_throw_error(NULL, "Attempt to unset static property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name));
        return 0;
index 77ac85039f066703e2c884bbd33e03610e232243..0bd8c7ec799f304d2b45e95939a91eb7af1ca405 100644 (file)
@@ -163,7 +163,7 @@ extern ZEND_API zend_object_handlers std_object_handlers;
 BEGIN_EXTERN_C()
 ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
 ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, zend_bool silent);
-ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
+ZEND_API ZEND_COLD zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
 ZEND_API union _zend_function *zend_std_get_constructor(zend_object *object);
 ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_string *member, int silent);
 ZEND_API HashTable *zend_std_get_properties(zval *object);
index 55523501c749711a0907491c69aaf65f619286b2..77cd3ee734c698ea0a88b1b94ed8d5fd6d4a8f70 100644 (file)
@@ -216,9 +216,13 @@ char *alloca();
 #if defined(__GNUC__) && ZEND_GCC_VERSION >= 4003
 # define ZEND_ATTRIBUTE_UNUSED __attribute__((unused))
 # define ZEND_ATTRIBUTE_UNUSED_LABEL __attribute__((cold, unused));
+# define ZEND_COLD __attribute__((cold))
+# define ZEND_HOT __attribute__((cold))
 #else
 # define ZEND_ATTRIBUTE_UNUSED
 # define ZEND_ATTRIBUTE_UNUSED_LABEL
+# define ZEND_COLD __attribute__((cold))
+# define ZEND_HOT __attribute__((cold));
 #endif
 
 #if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)