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

David Matthew Overton dmo at students.cs.mu.OZ.AU
Tue Jun 23 10:43:42 AEST 1998


On Mon, Jun 22, 1998 at 09:18:45PM +1000, Fergus Henderson wrote:
> On 22-Jun-1998, David Matthew Overton <dmo at students.cs.mu.oz.au> wrote:
> > compiler/export.m:
> > 	Add `ref_in' and `ref_out' arg_modes to switches in
> > 	`get_input_args' and `copy_output_args'.  But don't produce
> > 	any code for them yet. (XXXs have been added in appropriate
> > 	places).
> 
> I think it would be better to add calls to
> 
> 	error("Sorry, not yet implemented: ...")
> 
> as well as the XXXs.

Ok.  I'll do that.
> 
> > compiler/modecheck_unify.m:
> > 	Add support for `free(alias)' insts.
> > 	Disallow scheduling of constructions of partially instantiated
> > 	data structures until we come up with a better algorithm for
> > 	when this should be done and when it shouldn't.  At the
> > 	moment, partially instantiated data structures are only
> > 	created by LCO, which is called after mode checking.
> 
> Could you explain the rationale for this change in a bit more detail?
> What would be wrong with say scheduling such constructions at the
> earliest point possible?
> 
As Andrew pointed out, scheduling constructions as early as possible
is not always a good idea  This change ensures that, without
`--optimize-constructor-last-call',  the compiler will produce the same
code as before the change, which I think is reasonable for now.
Obviously this will need to change when we start allowing users to
create their own partially-instantiated data structures.

David
-- 
David Overton
MEngSc Student                       Email: dmo at cs.mu.oz.au     
Department of Computer Science       Web: http://www.cs.mu.oz.au/~dmo
The University of Melbourne          Phone: +61 3 9344 9159



More information about the developers mailing list