Commit 2984afcd authored by Ben Gamari's avatar Ben Gamari 🐢

Shortcutting

parent 08b40fe6
...@@ -568,6 +568,7 @@ void updateRemembSetPushThunkEager(Capability *cap, ...@@ -568,6 +568,7 @@ void updateRemembSetPushThunkEager(Capability *cap,
StgThunk *thunk) StgThunk *thunk)
{ {
/* N.B. info->i.type mustn't be WHITEHOLE */ /* N.B. info->i.type mustn't be WHITEHOLE */
MarkQueue *queue = &cap->upd_rem_set.queue;
switch (info->i.type) { switch (info->i.type) {
case THUNK: case THUNK:
case THUNK_1_0: case THUNK_1_0:
...@@ -576,7 +577,6 @@ void updateRemembSetPushThunkEager(Capability *cap, ...@@ -576,7 +577,6 @@ void updateRemembSetPushThunkEager(Capability *cap,
case THUNK_1_1: case THUNK_1_1:
case THUNK_0_2: case THUNK_0_2:
{ {
MarkQueue *queue = &cap->upd_rem_set.queue;
push_thunk_srt(queue, &info->i); push_thunk_srt(queue, &info->i);
for (StgWord i = 0; i < info->i.layout.payload.ptrs; i++) { for (StgWord i = 0; i < info->i.layout.payload.ptrs; i++) {
...@@ -590,7 +590,6 @@ void updateRemembSetPushThunkEager(Capability *cap, ...@@ -590,7 +590,6 @@ void updateRemembSetPushThunkEager(Capability *cap,
} }
case AP: case AP:
{ {
MarkQueue *queue = &cap->upd_rem_set.queue;
StgAP *ap = (StgAP *) thunk; StgAP *ap = (StgAP *) thunk;
if (check_in_nonmoving_heap(ap->fun)) { if (check_in_nonmoving_heap(ap->fun)) {
push_closure(queue, ap->fun, NULL); push_closure(queue, ap->fun, NULL);
...@@ -602,6 +601,16 @@ void updateRemembSetPushThunkEager(Capability *cap, ...@@ -602,6 +601,16 @@ void updateRemembSetPushThunkEager(Capability *cap,
case BLACKHOLE: case BLACKHOLE:
// TODO: This is right, right? // TODO: This is right, right?
break; 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: default:
barf("updateRemembSetPushThunk: invalid thunk pushed: p=%p, type=%d", barf("updateRemembSetPushThunk: invalid thunk pushed: p=%p, type=%d",
thunk, info->i.type); thunk, info->i.type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment