diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-07-16 15:22:29 +0300 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-22 12:20:15 -0400 |
commit | 875861efae06a7a35e3cf3fa76faaea9f33903dd (patch) | |
tree | c1d2029c942ff636891f1debd898d0f3cb226bfd /rts/sm/NonMovingMark.c | |
parent | 246ce2af639ce192c894ca40d283c04c52d4b750 (diff) | |
download | haskell-875861efae06a7a35e3cf3fa76faaea9f33903dd.tar.gz |
NonMoving: Implement selector optimisation
Diffstat (limited to 'rts/sm/NonMovingMark.c')
-rw-r--r-- | rts/sm/NonMovingMark.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c index 751406c650..acf84d44f1 100644 --- a/rts/sm/NonMovingMark.c +++ b/rts/sm/NonMovingMark.c @@ -11,6 +11,7 @@ // This is sometimes declared as a register variable therefore it is necessary // to include the declaration so that the compiler doesn't clobber the register. #include "NonMovingMark.h" +#include "NonMovingShortcut.h" #include "NonMoving.h" #include "BlockAlloc.h" /* for countBlocks */ #include "HeapAlloc.h" @@ -24,7 +25,7 @@ #include "MarkWeak.h" #include "sm/Storage.h" -static void mark_closure (MarkQueue *queue, StgClosure *p, StgClosure **origin); +static void mark_closure (MarkQueue *queue, const StgClosure *p, StgClosure **origin); static void mark_tso (MarkQueue *queue, StgTSO *tso); static void mark_stack (MarkQueue *queue, StgStack *stack); static void mark_PAP_payload (MarkQueue *queue, @@ -1445,8 +1446,7 @@ mark_closure (MarkQueue *queue, const StgClosure *p0, StgClosure **origin) } case THUNK_SELECTOR: - PUSH_FIELD((StgSelector *) p, selectee); - // TODO: selector optimization + nonmoving_eval_thunk_selector(queue, (StgSelector*)p, origin); break; case AP_STACK: { @@ -1592,6 +1592,7 @@ done: if (origin != NULL && (!HEAP_ALLOCED(p) || bd->flags & BF_NONMOVING)) { if (UNTAG_CLOSURE((StgClosure*)p0) != p && *origin == p0) { if (cas((StgVolatilePtr)origin, (StgWord)p0, (StgWord)TAG_CLOSURE(tag, p)) == (StgWord)p0) { + // debugBelch("Thunk optimization successful\n"); } } } |