[sgen] Only do fence when concurrent collection is running.
[mono.git] / mono / sgen / sgen-minor-scan-object.h
index 4b62a739f27183622a0dbc4441e1ea2b17536b9c..cc3e7a4539e794037d54c6055196b2d9df815fef 100644 (file)
 
 extern guint64 stat_scan_object_called_nursery;
 
+#undef SERIAL_SCAN_OBJECT
+#undef SERIAL_SCAN_VTYPE
+#undef SERIAL_SCAN_PTR_FIELD
+
 #if defined(SGEN_SIMPLE_NURSERY)
+
+#ifdef SGEN_CONCURRENT_MAJOR
+#define SERIAL_SCAN_OBJECT simple_nursery_serial_with_concurrent_major_scan_object
+#define SERIAL_SCAN_VTYPE simple_nursery_serial_with_concurrent_major_scan_vtype
+#define SERIAL_SCAN_PTR_FIELD simple_nursery_serial_with_concurrent_major_scan_ptr_field
+#else
 #define SERIAL_SCAN_OBJECT simple_nursery_serial_scan_object
 #define SERIAL_SCAN_VTYPE simple_nursery_serial_scan_vtype
+#define SERIAL_SCAN_PTR_FIELD simple_nursery_serial_scan_ptr_field
+#endif
 
 #elif defined (SGEN_SPLIT_NURSERY)
+
+#ifdef SGEN_CONCURRENT_MAJOR
+#define SERIAL_SCAN_OBJECT split_nursery_serial_with_concurrent_major_scan_object
+#define SERIAL_SCAN_VTYPE split_nursery_serial_with_concurrent_major_scan_vtype
+#define SERIAL_SCAN_PTR_FIELD split_nursery_serial_with_concurrent_major_scan_ptr_field
+#else
 #define SERIAL_SCAN_OBJECT split_nursery_serial_scan_object
 #define SERIAL_SCAN_VTYPE split_nursery_serial_scan_vtype
+#define SERIAL_SCAN_PTR_FIELD split_nursery_serial_scan_ptr_field
+#endif
 
 #else
-#error "Please define GC_CONF_NAME"
+#error "No nursery configuration specified"
 #endif
 
 #undef HANDLE_PTR
@@ -75,8 +95,8 @@ SERIAL_SCAN_PTR_FIELD (GCObject *full_object, GCObject **ptr, SgenGrayQueue *que
        HANDLE_PTR (ptr, NULL);
 }
 
-#define FILL_MINOR_COLLECTOR_SCAN_OBJECT(collector)    do {                    \
-               (collector)->serial_ops.scan_object = SERIAL_SCAN_OBJECT;       \
-               (collector)->serial_ops.scan_vtype = SERIAL_SCAN_VTYPE; \
-               (collector)->serial_ops.scan_ptr_field = SERIAL_SCAN_PTR_FIELD; \
+#define FILL_MINOR_COLLECTOR_SCAN_OBJECT(ops)  do {                    \
+               (ops)->scan_object = SERIAL_SCAN_OBJECT;                        \
+               (ops)->scan_vtype = SERIAL_SCAN_VTYPE;                  \
+               (ops)->scan_ptr_field = SERIAL_SCAN_PTR_FIELD;          \
        } while (0)