summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-10-15 17:36:32 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-22 12:20:15 -0400
commitc72e84c6afeadb0b29db181608ebfd2facd841e1 (patch)
treeb40e95db6544079d011558beade4e77427dd9525 /rts
parent875861efae06a7a35e3cf3fa76faaea9f33903dd (diff)
downloadhaskell-c72e84c6afeadb0b29db181608ebfd2facd841e1.tar.gz
NonMovingMark: Handle INDs left by shortcutting
Diffstat (limited to 'rts')
-rw-r--r--rts/sm/NonMovingMark.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index acf84d44f1..846c02bbfd 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -565,6 +565,7 @@ void updateRemembSetPushThunkEager(Capability *cap,
StgThunk *thunk)
{
/* N.B. info->i.type mustn't be WHITEHOLE */
+ MarkQueue *queue = &cap->upd_rem_set.queue;
switch (info->i.type) {
case THUNK:
case THUNK_1_0:
@@ -573,7 +574,6 @@ void updateRemembSetPushThunkEager(Capability *cap,
case THUNK_1_1:
case THUNK_0_2:
{
- MarkQueue *queue = &cap->upd_rem_set.queue;
push_thunk_srt(queue, &info->i);
for (StgWord i = 0; i < info->i.layout.payload.ptrs; i++) {
@@ -587,7 +587,6 @@ void updateRemembSetPushThunkEager(Capability *cap,
}
case AP:
{
- MarkQueue *queue = &cap->upd_rem_set.queue;
StgAP *ap = (StgAP *) thunk;
if (check_in_nonmoving_heap(ap->fun)) {
push_closure(queue, ap->fun, NULL);
@@ -599,6 +598,16 @@ void updateRemembSetPushThunkEager(Capability *cap,
case BLACKHOLE:
// TODO: This is right, right?
break;
+ // The selector optimization performed by the nonmoving mark may have
+ // overwritten a thunk which we are updating with an indirection.
+ case IND:
+ {
+ StgInd *ind = (StgInd *) thunk;
+ if (check_in_nonmoving_heap(ind->indirectee)) {
+ push_closure(queue, ind->indirectee, NULL);
+ }
+ break;
+ }
default:
barf("updateRemembSetPushThunk: invalid thunk pushed: p=%p, type=%d",
thunk, info->i.type);