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

Andrew Bromage bromage at cs.mu.OZ.AU
Thu Jun 25 09:48:08 AEST 1998


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.

> > 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.  It could be not as efficient (say, in this case)
as it could be, though.

Cheers,
Andrew Bromage



More information about the developers mailing list