Hello Simon,
I've been tracking down a bug where the new code generator uses more
stack space than it really ought to. I've pinned it down to this
combination of factors:
* Call areas that have any of their slots live at the same time
will not be overlapped.
* The old call area always contains a return address at the
youngest end, which is always live in the case of tail calls.
As a result, the old call area is live through the entire procedure,
and all the other areas are forced to live below it.
However, this is a bit wasteful, especially if the old call area
had some arguments: those arguments almost always become immediately
dead and that space can be reused. In some cases, the space used
by the arguments is all we need, and we can skip doing a stack check
and emitting code for a GC.
My initial thought was to allow the stack layout code to do overlapping
layouts based on the liveness analysis, but it's not clear if that's
always kosher. Simon Marlow suggested that we split the old call area
into a "return address" area and an "old" area, since the old code
generator didn't know about the return address when it was doing its
layout. We wanted to consult with someone who was a bit more familiar
with the stack layout code.
Cheers,
Edward
P.S. I won't be around the beginning of next week.
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc