summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-05-16 16:28:32 +0300
committerBen Gamari <ben@smart-cactus.org>2019-10-22 12:20:15 -0400
commit0f8fd3c6ad52dc057d192e3b84e9d10c5503662c (patch)
tree571c1a2c7dbf44465ee158e23b407e692de85524 /rts
parentc72e84c6afeadb0b29db181608ebfd2facd841e1 (diff)
downloadhaskell-0f8fd3c6ad52dc057d192e3b84e9d10c5503662c.tar.gz
NonMoving: Implement -xns to disable selector optimizationwip/gc/shortcutting
Diffstat (limited to 'rts')
-rw-r--r--rts/RtsFlags.c5
-rw-r--r--rts/sm/NonMovingMark.c6
2 files changed, 10 insertions, 1 deletions
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: {