explicit arrays and limit checks

Matthew Fluet fluet@cs.cornell.edu
Sun, 17 Feb 2002 17:53:59 -0500 (EST)


> > But, in the explict branch, this is a serious problem, because the MACHINE
> > IL is outputing runtime transfers with Prim.gcCollect with the arguments
> > we need; but x86-mlton is assuming that any GC_collect is nullary and just
> > filling in amount = 0, force = TRUE.  What it should really do is use
> > arguments if they are there, otherwise use the default.
> 
> Makes sense, except that I don't see the overloading.  I changed the
> basis library so that GC_collect is of type word * bool -> unit.  So,
> all calls that the codegen sees should have two args.

Great.  I didn't check the basis library;  

Anyways, regressions passed fine with one outstanding but with
mlton.word.sml -- I see you added Word32_{add,mul}Check which use the
carry flag to signal overflow.  That's fine, but the peephole optimization
that turns adds with an immediate of 1 into an inc instruction is not
valid in this case, because the inc instruction does not set the CF flag;
I just need to add enough checks to make sure subsequent instructions
aren't checking the CF flag.

A self compile finished fine and is halfway through regressions without
problems.  I'll check in my changes shortly and change the GC_collect
translation to always assume two arguments.