FIX #1038: failure of selector-thunk machinery to do its job
authorSimon Marlow <simonmar@microsoft.com>
Mon, 17 Sep 2007 15:18:34 +0000 (15:18 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Mon, 17 Sep 2007 15:18:34 +0000 (15:18 +0000)
commit2018c430c8eb41cc323616536fffb5830a1e3a65
treedde393ade1f144549682efc9e3c70a1d5131f015
parent442099ad2dbcc007b137745b9246116f06c8723d
FIX #1038: failure of selector-thunk machinery to do its job
After a couple of abortive attempts, I think I've got this right.
When the GC sees a chain of the form

   snd (_, snd (_, snd (_, ...)))

it can now deal with an arbitrary nesting depth, whereas previously it
had a depth limit which was necessitated by the use of recursion.  Now
we chain all the selector thunks together in the heap, and go back and
update them all when we find the value at the end of the chain.

While I was here I removed some old cruft in eval_thunk_selector()
which was carefully manintaing invariants that aren't necessary any
more, the main one being that evacuate() can safely be passed a
to-space pointer now.

In addition to validate I've tested building a stage3 compiler with
and without +RTS -c, so I'm reasonably sure this is safe.
rts/sm/Evac.c