* 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 inline void
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 };
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);
+ if (G_UNLIKELY (MONO_GC_OBJ_MOVED_ENABLED ())) {
+ int dest_gen = sgen_ptr_in_nursery (destination) ? GENERATION_NURSERY : GENERATION_OLD;
+ int src_gen = sgen_ptr_in_nursery (obj) ? GENERATION_NURSERY : GENERATION_OLD;
+ MONO_GC_OBJ_MOVED ((mword)destination, (mword)obj, dest_gen, src_gen, objsize, vt->klass->name_space, vt->klass->name);
+ }
+
if (objsize <= sizeof (gpointer) * 8) {
mword *dest = (mword*)destination;
goto *copy_labels [objsize / sizeof (gpointer)];
}
}
-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;
#ifdef GENERATE_COPY_FUNCTIONS
+extern long long stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */
+
+#if defined(SGEN_SIMPLE_NURSERY)
+#define serial_copy_object simple_nursery_serial_copy_object
+#define parallel_copy_object simple_nursery_parallel_copy_object
+
+#elif defined (SGEN_SPLIT_NURSERY)
+
+#define serial_copy_object split_nursery_serial_copy_object
+#define parallel_copy_object split_nursery_parallel_copy_object
+
+#else
+#error "Please define GC_CONF_NAME"
+#endif
+
/*
* This is how the copying happens from the nursery to the old generation.
* We assume that at this time all the pinned objects have been identified and
* 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;
}
}
-#endif
\ No newline at end of file
+#endif