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

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 20 07:27:45 AEDT 2001


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.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  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