RSSA

Stephen Weeks MLton@sourcelight.com
Sat, 22 Dec 2001 16:15:43 -0800


> What is the intuitive distinction between Operand.t and Var.t?  There just
> seem to be a number of places where you require Var.t that would seem to
> work equally well with Operand.t.

Arbitrary for now -- it's just what I needed.  I can see all uses of
Var.t (except binding occurrences) in statements and transfers being
replaced by Operand.t.

> > 	       Array of {dst: Var.t,
> > 			 numBytesNonPointers: int,
> > 			 numElts: Var.t,
> > 			 numPointers: int}
> 
> I'd still like to shoot for some future point where Array's aren' as
> privileged.

Yeah.  But this is an improvement over the previous world -- the above
does not implicitly include a limit check.  Even better, but I hadn't
thought about it yet would be to spell out initialization loops (for
pointer arrays) in this IL.  Actually, this datatype didn't rule that
out.  In accordance with your next suggestion, I guess we could go to

   Array of {dst: Var.t, header: Word.t, length: Operand.t}
	
> 
> > 	     | Object of {dst: Var.t,
> > 			  numPointers: int,
> > 			  numWordsNonPointers: int,
> > 			  stores: {offset: int, (* bytes *)
> > 				   value: Operand.t} vector}
> 
> Why do we need numPointers and numWordsNonPointes here?  I know we
> eventually need them for the header word, but why not just put a Word.t
> here?

I.E. compute the header here?  I have no strong objection.  It might
make it slightly harder to switch gc's, but who knows.

> 
> > 	     | LimitCheck of {kind: LimitCheck.t,
> > 			      return: Label.t}
> 
> I know the LimitCheck.t kind is encoding a lot, but it might be simpler to
> make the limit check a Runtim transfer with appropriate argument
> encodings.

I don't see how to do this except to push the sum type inside the
runtime variant, like

	datatype Runtime.t = 
            LimitCheck of LimitCheck.t
          | PrimApp of {prim: Prim.t, args: Var.t vector}


	     | Runtime of {call: Runtime.t,
			   return: Label.t (* Must be nullary. *)
			  }

This doesn't seem like a win to me.  Did you have something else in
mind?  Changing the Prim type?  That seems bad to me.


I'm off to Dallas and will be gone until Wednesday night or Thursday.
Happy Holidays to all!