From f4499071a806cf18b28ccb5ad5c7d0f3c641b5e5 Mon Sep 17 00:00:00 2001 From: Rodrigo Kumpera Date: Mon, 13 Aug 2012 20:07:44 -0300 Subject: [PATCH] Sprinkle some inlining annotations magic to bring performance back to the 2.10 levels. * sgen-copy-object.h: For some reason gcc's inlining heuristics for serial_copy_object from serial_scan_object reason not to inline it. This causes a 20% increase in nursery scanning times. Be explicit about inlining hints to make sure we get what we need. --- mono/metadata/sgen-copy-object.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mono/metadata/sgen-copy-object.h b/mono/metadata/sgen-copy-object.h index 7b7aea398b3..aad35230724 100644 --- a/mono/metadata/sgen-copy-object.h +++ b/mono/metadata/sgen-copy-object.h @@ -34,7 +34,7 @@ extern long long stat_slots_allocated_in_vain; * This function can be used even if the vtable of obj is not valid * anymore, which is the case in the parallel collector. */ -static void +static void __attribute__((always_inline)) par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword objsize, SgenGrayQueue *queue) { static const void *copy_labels [] = { &&LAB_0, &&LAB_1, &&LAB_2, &&LAB_3, &&LAB_4, &&LAB_5, &&LAB_6, &&LAB_7, &&LAB_8 }; @@ -84,7 +84,7 @@ par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword o } } -static G_GNUC_UNUSED void* +static G_GNUC_UNUSED void* __attribute__((noinline)) copy_object_no_checks (void *obj, SgenGrayQueue *queue) { MonoVTable *vt = ((MonoObject*)obj)->vtable; @@ -144,8 +144,8 @@ extern long long stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */ * copy_object could be made into a macro once debugged (use inline for now). */ -static void -serial_copy_object (void **obj_slot, SgenGrayQueue *queue) +static inline void __attribute__((always_inline)) +serial_copy_object (void **obj_slot, SgenGrayQueue *queue) { char *forwarded; char *obj = *obj_slot; -- 2.11.4.GIT