[m-rev.] diff: improve boxing and unboxing in IL backend.

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Aug 5 16:26:17 AEST 2001


On 02-Aug-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 03-Aug-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 26-Jul-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > > +		( already_boxed(RvalILType) ->
> > > +			( RvalType = mercury_type(_, user_type) ->
> > > +				% XXX we should look into a nicer way to
> > > +				% generate MLDS so we don't need to do this
> > > +				Instrs = tree__list([
> > > +					comment_node(
> > > +						"loading out of an MR_Word"),
> > > +					instr_node(ldc(int32, i(0))),
> > > +					instr_node(ldelem(
> > > +						il_generic_simple_type)),
> > > +					comment_node(
> > > +						"turning a cast into an unbox"),
> > > +					convert_from_object(ILType)
> > > +				])
> > 
> > I'm pretty sure that code is wrong for --high-level-data.
> 
> If it were every triggered, it would be. 
> 
> But --high-level-data should be loading from fields using field rvals,
> not cast.
> 
> I think this only comes up in low-level-data.

In that case, there should at least be a sanity check there to test that
--high-level-data is not enabled

> > > +			% It would be good if we didn't generate 
> > > +			% such code, but it's no big deal
> > > +		Instrs = empty
> > 
> > What do you mean by the last sentence in the comment?
> 
> I think I was just a little mislead, my comment is unjustified.

OK, I've deleted the comment.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list