handler labels

Matthew Fluet fluet@research.nj.nec.com
Sat, 12 Aug 2000 13:27:32 -0400 (EDT)


> > But handlers are handled differently?
> 
> No.  They are in the entries list.

But are all of them there?  Reason being, I find labels that are never
explicitly jumped to, are only every stored to the stack, but are not on
the entries list -- and are always manipulated right before a save/restore
exn stack (so I assumed they were handlers.)

> > I
> > think that might explain why I'm getting unresolved symbols.  I wanted to
> > be aggressive and simply count all the jumps to each label
> 
> Surely you want to count stores of the label to the stack as a reference.  This
> is what happens with handlers and conts.

Definitely, although stores of a label to the stack automatically force
that label to exist in the output (like with gcReturns and entries),
because I can't count which "jmp (stackTop)"s actually do the transfers to
that label.  The issue was whether I wanted to walk over the whole program
and recognize such stores or whether I could just take them as precomputed
values.  At first I thought the later, but now I suspect that isn't the
case.

> You need to keep every label that is referred to, either via jump or reference.

No.  Definitely anything by reference, but the C-codegen uses a
"maybe-print-label" to dump those that aren't needed.