local refs

Matthew Fluet fluet@CS.Cornell.EDU
Sun, 2 Dec 2001 21:13:54 -0500 (EST)


> > At present, localRef is not.  In particular if an 'a ref ref is
> > localizable, then the 'a ref which it wraps might itself be localizable.
> 
> Exactly the case I was thinking of, and similarly the interaction with
> local-flattening, where the ref is stuck in a locally-flattenable
> tuple.

I don't think the 'a ref ref case is so hard to get, because it's very
much in the spirit of the analysis.  Combining with local-flattening might
be a little harder.

> 1. Is it necessary for the transformation to traverse the dominator
> tree instead of the DFS tree?

Perhaps not.  All the join points will have been calculated, so I think we
could traverse the DFS tree.

Although, it shouldn't make a speed difference.  We needed to traverse the
dominator tree to compute the join points, so the promise has been forced;
i.e., we aren't doing another dominator calculation.

> 2. In the following program, why isn't func (aka global_17) localized?
> I looked at the diagnostics and global_17's isLocal = true, but for
> some reason, it still appears in the output.

It's the handler problem; the current incarnation does not rewrite
handlers, so if we try to carry a ref in args of a handler block, we punt
and mark the ref as nonLocal (after having printed the diagnostics). See
the code marked (* Compensate for handlers *).