From: Rodrigo Kumpera Date: Thu, 31 Aug 2017 18:20:31 +0000 (-0700) Subject: [wasm][sgen] Introduce DEFAULT_SWEEP_MODE, move DEFAULT_MAJOR to sgen-config.h and... X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=aaf5672018ed5cf20025a51943ca0ed6b5e86277 [wasm][sgen] Introduce DEFAULT_SWEEP_MODE, move DEFAULT_MAJOR to sgen-config.h and make wasm defaults serial. --- diff --git a/mono/sgen/sgen-conf.h b/mono/sgen/sgen-conf.h index 53e962c2b70..5e8866ffff8 100644 --- a/mono/sgen/sgen-conf.h +++ b/mono/sgen/sgen-conf.h @@ -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 diff --git a/mono/sgen/sgen-gc.c b/mono/sgen/sgen-gc.c index 54ff725b22b..1c54fc261f9 100644 --- a/mono/sgen/sgen-gc.c +++ b/mono/sgen/sgen-gc.c @@ -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, diff --git a/mono/sgen/sgen-marksweep.c b/mono/sgen/sgen-marksweep.c index 5f4185d4df7..e06ac6d3f83 100644 --- a/mono/sgen/sgen-marksweep.c +++ b/mono/sgen/sgen-marksweep.c @@ -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;