[m-dev.] introduce box/unbox float operators in HLDS

Ralph Becket rbeck at microsoft.com
Fri Mar 16 01:22:08 AEDT 2001


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
> Sent: 15 March 2001 11:31
> 
> In the MLDS back-end, fields are always boxed, 

Why does it do that?  I thought fields were just syntactic sugar.

> but local variables
> are only boxed if they have a polymorphic type.  The code for the
> above source fragment will first extract the fields of p/1 and copy
> them into local variables (hence they need to be unboxed)
> and then construct a new p/2 struct on the heap and copy the local
> variables into fields of this (hence they need to be boxed).
> 
> In this case, it would be more efficient to keep the local variable
boxed.
> But the MLDS back-end doesn't try to do that.

Is this because there's no explicit notion of `boxed type' in the MLDS?

- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list