summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/rts/Flags.h4
-rw-r--r--rts/RtsFlags.c5
-rw-r--r--rts/sm/NonMovingMark.c6
3 files changed, 13 insertions, 2 deletions
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index 9a039fd95c..f27ce23b0b 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -52,7 +52,9 @@ typedef struct _GC_FLAGS {
double oldGenFactor;
double pcFreeHeap;
- bool useNonmoving;
+ bool useNonmoving; // default = false
+ bool nonmovingSelectorOpt; // Do selector optimization in the
+ // non-moving heap, default = false
uint32_t generations;
bool squeezeUpdFrames;
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index c606d86418..0e28b980ac 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -157,6 +157,7 @@ void initRtsFlagsDefaults(void)
RtsFlags.GcFlags.pcFreeHeap = 3; /* 3% */
RtsFlags.GcFlags.oldGenFactor = 2;
RtsFlags.GcFlags.useNonmoving = false;
+ RtsFlags.GcFlags.nonmovingSelectorOpt = false;
RtsFlags.GcFlags.generations = 2;
RtsFlags.GcFlags.squeezeUpdFrames = true;
RtsFlags.GcFlags.compact = false;
@@ -1542,6 +1543,10 @@ error = true;
OPTION_SAFE;
RtsFlags.GcFlags.useNonmoving = true;
unchecked_arg_start++;
+ if (rts_argv[arg][3] == 's') {
+ RtsFlags.GcFlags.nonmovingSelectorOpt = true;
+ unchecked_arg_start++;
+ }
break;
case 'c': /* Debugging tool: show current cost centre on
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index 846c02bbfd..59db431848 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -1455,7 +1455,11 @@ mark_closure (MarkQueue *queue, const StgClosure *p0, StgClosure **origin)
}
case THUNK_SELECTOR:
- nonmoving_eval_thunk_selector(queue, (StgSelector*)p, origin);
+ if (RtsFlags.GcFlags.nonmovingSelectorOpt) {
+ nonmoving_eval_thunk_selector(queue, (StgSelector*)p, origin);
+ } else {
+ PUSH_FIELD((StgSelector *) p, selectee);
+ }
break;
case AP_STACK: {