* License 2.0 along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+#include "mono/utils/mono-compiler.h"
+
extern long long stat_copy_object_called_nursery;
extern long long stat_objects_copied_nursery;
* This function can be used even if the vtable of obj is not valid
* anymore, which is the case in the parallel collector.
*/
-static inline void
+static MONO_ALWAYS_INLINE void
par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword objsize, SgenGrayQueue *queue)
{
#ifdef __GNUC__
/*
* This can return OBJ itself on OOM.
*/
-#ifdef _MSC_VER
-static __declspec(noinline) void*
-#else
-static G_GNUC_UNUSED void* __attribute__((noinline))
-#endif
+static MONO_NEVER_INLINE void*
copy_object_no_checks (void *obj, SgenGrayQueue *queue)
{
MonoVTable *vt = ((MonoObject*)obj)->vtable;
extern long long stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */
+#include "mono/utils/mono-compiler.h"
+
#include "sgen-copy-object.h"
/*
* copy_object could be made into a macro once debugged (use inline for now).
*/
-#ifdef _MSC_VER
-static __forceinline void
-#else
-static inline void __attribute__((always_inline))
-#endif
+static MONO_ALWAYS_INLINE void
SERIAL_COPY_OBJECT (void **obj_slot, SgenGrayQueue *queue)
{
char *forwarded;
*
* Similar to SERIAL_COPY_OBJECT, but assumes that OBJ_SLOT is part of an object, so it handles global remsets as well.
*/
-#ifdef _MSC_VER
-static __forceinline void
-#else
-static inline void __attribute__((always_inline))
-#endif
+static MONO_ALWAYS_INLINE void
SERIAL_COPY_OBJECT_FROM_OBJ (void **obj_slot, SgenGrayQueue *queue)
{
char *forwarded;
#include "mini.h"
#include "mini-arm.h"
#include "mono/utils/mono-sigcontext.h"
+#include "mono/utils/mono-compiler.h"
/*
* arch_get_restore_context:
* This works around a gcc 4.5 bug:
* https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/721531
*/
-#if defined(__GNUC__)
-__attribute__((noinline))
-#endif
-static gpointer
+static MONO_NEVER_INLINE gpointer
get_handle_signal_exception_addr (void)
{
return handle_signal_exception;
#include <mono/utils/mono-counters.h>
#include <mono/utils/mono-error-internals.h>
#include <mono/utils/mono-membar.h>
+#include <mono/utils/mono-compiler.h>
#include "mini.h"
/*
* Either IMPL_METHOD or AOT_ADDR will be set on return.
- */
-static gpointer*
-#ifdef __GNUC__
-/*
+ *
+ * MONO_NEVER_INLINE :
* This works against problems when compiling with gcc 4.6 on arm. The 'then' part of
* this line gets executed, even when the condition is false:
* if (impl && mono_method_needs_static_rgctx_invoke (impl, FALSE))
* *need_rgctx_tramp = TRUE;
*/
-__attribute__ ((noinline))
-#endif
- mono_convert_imt_slot_to_vtable_slot (gpointer* slot, mgreg_t *regs, guint8 *code, MonoMethod *method, gboolean lookup_aot, MonoMethod **impl_method, gboolean *need_rgctx_tramp, gboolean *variance_used, gpointer *aot_addr)
+static MONO_NEVER_INLINE gpointer*
+mono_convert_imt_slot_to_vtable_slot (gpointer* slot, mgreg_t *regs, guint8 *code, MonoMethod *method, gboolean lookup_aot, MonoMethod **impl_method, gboolean *need_rgctx_tramp, gboolean *variance_used, gpointer *aot_addr)
{
MonoObject *this_argument = mono_arch_get_this_arg_from_call (regs, code);
MonoVTable *vt = this_argument->vtable;
#include "image-writer.h"
#include "dwarfwriter.h"
+#include "mono/utils/mono-compiler.h"
+
#define USE_GDB_JIT_INTERFACE
/* The recommended gdb macro is: */
struct jit_code_entry *first_entry;
};
-
-#ifdef _MSC_VER
-#define MONO_NOINLINE __declspec (noinline)
-#else
-#define MONO_NOINLINE __attribute__((noinline))
-#endif
-
/* GDB puts a breakpoint in this function. */
-void MONO_NOINLINE __jit_debug_register_code(void);
+void MONO_NEVER_INLINE __jit_debug_register_code(void);
#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM) && !defined(MONO_CROSS_COMPILE)
#else
/* gcc seems to inline/eliminate calls to noinline functions, thus the asm () */
-void MONO_NOINLINE __jit_debug_register_code(void) {
+void MONO_NEVER_INLINE __jit_debug_register_code(void) {
#if defined(__GNUC__)
asm ("");
#endif
#include <linux/ioctl.h>
#include <asm/byteorder.h>
+#include "mono/utils/mono-compiler.h"
+
/*
* User-space ABI bits:
*/
perf_arch_fetch_caller_regs(regs, CALLER_ADDR0);
}
-static __always_inline void
+static MONO_ALWAYS_INLINE void
perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
{
struct pt_regs hot_regs;
#define MONO_ALWAYS_INLINE
#endif
+#ifdef __GNUC__
+#define MONO_NEVER_INLINE __attribute__((noinline))
+#elif defined(_MSC_VER)
+#define MONO_NEVER_INLINE __declspec(noinline)
+#else
+#define MONO_NEVER_INLINE
+#endif
+
#endif /* __UTILS_MONO_COMPILER_H__*/
#if defined(HOST_WIN32)
#include <mono/utils/mono-threads.h>
+#include <mono/utils/mono-compiler.h>
#include <limits.h>
}
#if HAVE_DECL___READFSDWORD==0
-static __inline__ __attribute__((always_inline))
-unsigned long long
+static MONO_ALWAYS_INLINE unsigned long long
__readfsdword (unsigned long offset)
{
unsigned long value;