From 3d984f7feb3fe29e28bf3a7781e40f8c14e7f1c6 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Mon, 23 Feb 2015 20:05:40 -0500 Subject: [PATCH] [runtime] Mark mono_set_pending_exception () as a cold function, so calling code is generated out-of-line. --- mono/metadata/object-internals.h | 2 +- mono/utils/mono-compiler.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h index 2fad026e3ee..4315a592d5a 100644 --- a/mono/metadata/object-internals.h +++ b/mono/metadata/object-internals.h @@ -645,7 +645,7 @@ typedef void (*MonoFreeMethodFunc) (MonoDomain *domain, MonoMethod *meth /* Used to initialize the method pointers inside vtables */ typedef gboolean (*MonoInitVTableFunc) (MonoVTable *vtable); -void mono_set_pending_exception (MonoException *exc) MONO_INTERNAL; +MONO_COLD void mono_set_pending_exception (MonoException *exc) MONO_INTERNAL; /* remoting and async support */ diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h index 24c92fbae52..51d3a4f4bbd 100644 --- a/mono/utils/mono-compiler.h +++ b/mono/utils/mono-compiler.h @@ -275,5 +275,11 @@ typedef SSIZE_T ssize_t; #define MONO_NEVER_INLINE #endif +#ifdef __GNUC__ +#define MONO_COLD __attribute__((cold)) +#else +#define MONO_COLD __attribute__((cold)) +#endif + #endif /* __UTILS_MONO_COMPILER_H__*/ -- 2.25.1