SSA
Stephen Weeks
MLton@sourcelight.com
Fri, 19 Oct 2001 09:43:49 -0700
> I don't think it will work with the way the runtime is currently set up.
> We know where the top of the cont stack is on a stack -- it's at the top
> of the stack. We don't know where the top of the handler stack is on a
> stack -- that's accessed through the exnStack element of a GC_thread
> structure. We'll trace the stack after hitting it's GC_thread, but
> there's no way to carry the exnStack to the walk of the stack.
Agreed.
> We could (?) always put the exnStack element in a place relative to the
> stack, say in the word immediately below stackBottom. (Although that sort
> of messes with getting stacks mod 8 aligned.) The GC_thread struct
> seems a little overly abstract -- it doesn't seem as though two threads
> with different exnStacks could point to the same execution stack?
Yes, I think you're right. We could flatten the GC_stack data
structure into the GC_thread data structure. That would be nice,
would save a little space, simplify the runtime a little, and enable
tracing the exception stack. I don't see any problem with alignment
-- with three words before the stack, one just has to ensure the first
word of the thread is aligned to 4 mod 8. So I guess we'll need two
bits for alignment to represent {0, 4, DontCare}.