[m-dev.] for review: last call modulo constructors [1/3]

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jun 25 14:44:03 AEST 1998


On 25-Jun-1998, Andrew Bromage <bromage at cs.mu.OZ.AU> wrote:
> G'day all.
> 
> Fergus Henderson wrote:
> 
> > > The `alias_many' is reserved for cases where not all the references
> > > are known in the current scope,
> > 
> > What about the case where all the references are known, but there is
> > more than one of them?
> 
> That's also free(alias).  Many of the changes to the code generator
> were to deal with precisely this case, in fact.

OK, in that case the distinction between free(alias) and free(alias_many)
isn't the number of aliases at all, it's whether or not they are all known
statically (at compile time).  The names are a bit misleading and so at
very least this should be clearly explained in the comments where those
names are defined.

> > > No.  Once it's free(alias), it's "tainted" until it's bound.
> > > 
> > > If X is aliased to f(Y), and X goes out of scope, Y is still free(alias),
> > > because when Y is bound, the value must be stored through a reference.
> > 
> > Why does the value have to be stored through a reference?
> > If there's nothing live that aliases Y, why does the cell refered to by
> > the reference need to be updated?
> > Couldn't the compiler just keep Y in a register?
> 
> OK, that wasn't such a good example.
> 
> It's before the first coffee and first thing in the morning for me,
> so I can't think of a good one apart from the "call by reference"
> case (where a reference is passed in from outside).  Let me have a
> think about this one.
> 
> It certainly doesn't hurt semantics to keep free(alias) as free(alias)
> until it is bound.

In the diff posted there are a lot of cases where free(unique) is allowed
but free(alias) is not or vice versa.  So it does hurt the semantics,
I think.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list