Only use labels as values if compiling with gcc.
authorJonathan Chambers <joncham@gmail.com>
Thu, 30 Aug 2012 23:55:49 +0000 (19:55 -0400)
committerJonathan Chambers <joncham@gmail.com>
Thu, 30 Aug 2012 23:55:49 +0000 (19:55 -0400)
mono/metadata/sgen-copy-object.h

index 7526a3f836309b9d0e1389d6418141892bf1052b..55f3f8fb409df043ffa509b986007cbbd8e55220 100644 (file)
@@ -37,12 +37,15 @@ extern long long stat_slots_allocated_in_vain;
 static inline void
 par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword objsize, SgenGrayQueue *queue)
 {
+#ifdef __GNUC__
        static const void *copy_labels [] = { &&LAB_0, &&LAB_1, &&LAB_2, &&LAB_3, &&LAB_4, &&LAB_5, &&LAB_6, &&LAB_7, &&LAB_8 };
+#endif
 
        DEBUG (9, g_assert (vt->klass->inited));
        DEBUG (9, fprintf (gc_debug_file, " (to %p, %s size: %lu)\n", destination, ((MonoObject*)obj)->vtable->klass->name, (unsigned long)objsize));
        binary_protocol_copy (obj, destination, vt, objsize);
-
+       
+#ifdef __GNUC__
        if (objsize <= sizeof (gpointer) * 8) {
                mword *dest = (mword*)destination;
                goto *copy_labels [objsize / sizeof (gpointer)];
@@ -68,6 +71,9 @@ par_copy_object_no_checks (char *destination, MonoVTable *vt, void *obj, mword o
                /*can't trust memcpy doing word copies */
                mono_gc_memmove (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
        }
+#else
+               mono_gc_memmove (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
+#endif
        /* adjust array->bounds */
        DEBUG (9, g_assert (vt->gc_descr));
        if (G_UNLIKELY (vt->rank && ((MonoArray*)obj)->bounds)) {