[sgen] Added some comments.
authorMark Probst <mark.probst@gmail.com>
Wed, 27 Aug 2014 21:33:56 +0000 (14:33 -0700)
committerMark Probst <mark.probst@gmail.com>
Mon, 29 Sep 2014 18:04:00 +0000 (11:04 -0700)
mono/metadata/sgen-gc.c
mono/metadata/sgen-major-scan-object.h
mono/metadata/sgen-scan-object.h

index 572c788c7077418ab694e47ccbe5f683ad4823f7..8a1518586c1bf113780898d552f0aaa697849e2a 100644 (file)
@@ -2310,6 +2310,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
 
        MONO_GC_CHECKPOINT_4 (GENERATION_NURSERY);
 
+       /* FIXME: why is this here? */
        ctx.scan_func = current_object_ops.scan_object;
        ctx.copy_func = NULL;
        ctx.queue = &gray_queue;
index 668a9cd6411910ec27346e3bed0eaca794622bb9..dafc1d7ea4d74a4a8beb46ac55b81687591f8f29 100644 (file)
@@ -37,6 +37,17 @@ extern long long stat_scan_object_called_major;
 #define CONCURRENT_NAME(x)     x
 #endif
 
+/*
+ * FIXME: We use the same scanning function in the concurrent collector whether we scan
+ * during the starting/finishing collection pause (with the world stopped) or from the
+ * concurrent worker thread.
+ *
+ * As long as the world is stopped, we should just follow pointers into the nursery and
+ * evict if possible.  In that case we also don't need the ALWAYS_ADD_TO_GLOBAL_REMSET case,
+ * which only seems to make sense for when the world is stopped, in which case we only need
+ * it because we don't follow into the nursery.
+ */
+
 #undef HANDLE_PTR
 #define HANDLE_PTR(ptr,obj)    do {                                    \
                void *__old = *(ptr);                                   \
index 78db6674cb4fdcb2842d8a601ee630c5233c1452..ad569dda3595206fad7a2dd294c5040688b119c1 100644 (file)
  * be considered undefined after executing this code.  The object's
  * GC descriptor must be in the variable "mword desc".
  *
+ * The macro `HANDLE_PTR` will be invoked for every reference encountered while scanning the
+ * object.  It is called with two parameters: The pointer to the reference (not the
+ * reference itself!) as well as the pointer to the scanned object.
+ *
  * Modifiers (automatically undefined):
  *
  * SCAN_OBJECT_NOSCAN - if defined, don't actually scan the object,