[wasm][sgen] Introduce DEFAULT_SWEEP_MODE, move DEFAULT_MAJOR to sgen-config.h and...
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 31 Aug 2017 18:20:31 +0000 (11:20 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 1 Sep 2017 21:52:55 +0000 (14:52 -0700)
mono/sgen/sgen-conf.h
mono/sgen/sgen-gc.c
mono/sgen/sgen-marksweep.c

index 53e962c2b702e7ea8a893dc940ea8d42d227b967..5e8866ffff869d2123ece47d39040009b0a95118 100644 (file)
@@ -104,6 +104,20 @@ typedef mword SgenDescriptor;
 #endif
 #endif
 
+#if defined (TARGET_WASM)
+#define DEFAULT_MAJOR SGEN_MAJOR_SERIAL
+#define DEFAULT_SWEEP_MODE SGEN_SWEEP_SERIAL
+#elif defined(HAVE_CONC_GC_AS_DEFAULT)
+/* Use concurrent major on deskstop platforms */
+#define DEFAULT_MAJOR SGEN_MAJOR_CONCURRENT
+#define DEFAULT_SWEEP_MODE SGEN_SWEEP_CONCURRENT
+#else
+#define DEFAULT_MAJOR SGEN_MAJOR_SERIAL
+#define DEFAULT_SWEEP_MODE SGEN_SWEEP_CONCURRENT
+#endif
+
+
+
 /*
  * Maximum level of debug to enable on this build.
  * Making this a constant enables us to put logging in a lot of places and
index 54ff725b22b3c169e7234dffde1a626cf11ee9c2..1c54fc261f9ecd5133b5edc84f467de7169917ec 100644 (file)
@@ -336,13 +336,6 @@ nursery_canaries_enabled (void)
 
 #define safe_object_get_size   sgen_safe_object_get_size
 
-#if defined(HAVE_CONC_GC_AS_DEFAULT)
-/* Use concurrent major on deskstop platforms */
-#define DEFAULT_MAJOR SGEN_MAJOR_CONCURRENT
-#else
-#define DEFAULT_MAJOR SGEN_MAJOR_SERIAL
-#endif
-
 typedef enum {
        SGEN_MAJOR_DEFAULT,
        SGEN_MAJOR_SERIAL,
index 5f4185d4df70ec4f48a692aae3edfc46cfd3396b..e06ac6d3f83f22177fa54f48f5dc96fa23870e98 100644 (file)
@@ -189,10 +189,15 @@ enum {
        SWEEP_STATE_COMPACTING
 };
 
+typedef enum {
+       SGEN_SWEEP_SERIAL = FALSE,
+       SGEN_SWEEP_CONCURRENT = TRUE,
+} SgenSweepMode;
+
 static volatile int sweep_state = SWEEP_STATE_SWEPT;
 
 static gboolean concurrent_mark;
-static gboolean concurrent_sweep = TRUE;
+static gboolean concurrent_sweep = DEFAULT_SWEEP_MODE;
 
 int sweep_pool_context = -1;