[m-rev.] [reuse] diff: use mlds instrs to remove tag for delete_object

Tyson Dowd trd at cs.mu.OZ.AU
Tue Mar 20 11:33:06 AEDT 2001


On 20-Mar-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 19-Mar-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > +ml_primary_tag(shared_local_tag(_, _)) = no.
> 
> That line is wrong.
> 
> > could you please tell me the correct fix to mlds_to_il.m?
> ...
> > +++ mlds_to_il.m	2001/03/19 11:55:18
> > @@ -991,7 +991,7 @@
> >  atomic_statement_to_il(comment(Comment), Instrs) -->
> >  	{ Instrs = node([comment(Comment)]) }.
> >  
> > -atomic_statement_to_il(delete_object(Target, _Size), Instrs) -->
> > +atomic_statement_to_il(delete_object(_Target, _Size), _Instrs) -->
> >  		% XXX we assume the code generator knows what it is
> >  		% doing and is only going to delete real objects (e.g.
> >  		% reference types).  It would perhaps be prudent to
> > @@ -1001,8 +1001,9 @@
> >  		% We implement delete_object by storing null in the
> >  		% lval, which hopefully gives the garbage collector a good
> >  		% solid hint that this storage is no longer required.
> > -	get_load_store_lval_instrs(Target, LoadInstrs, StoreInstrs),
> > -	{ Instrs = tree__list([LoadInstrs, instr_node(ldnull), StoreInstrs]) }.
> > +	{ error("atomic_statement_to_il: delete object NYI") }.
> > +	%get_load_store_lval_instrs(Target, LoadInstrs, StoreInstrs),
> > +	%{ Instrs = tree__list([LoadInstrs, instr_node(ldnull), StoreInstrs]) }.
> 
> Probably the correct fix here is to check if the rval is an lval,
> and if so, null it out (as before).  The case where it is not an rval,
> currently won't happen, since for IL we don't use tags; for that case
> you could either call error/1 or you could just ignore the delete_object.

This sounds correct to me.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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