[m-rev.] high level data: optimize single-functor case

Tyson Dowd trd at cs.mu.OZ.AU
Mon Nov 5 13:14:29 AEDT 2001


On 04-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Branches: main
> Estimated hours taken: 8
> 
> Another optimization of the high-level data representation for the .NET
> and Java back-ends: optimize the single-functor case.
> 
> compiler/ml_type_gen.m:
> 	When there is only a single functor (perhaps with some constants
> 	represented as reserved addresses), generate a single class, rather
> 	than generating a base class and a derived class.
> 
> compiler/ml_unify_gen.m:
> 	Pass down the cons_tag to ml_gen_field_id, so that it can check
> 	for the single_functor case and in that case generate references
> 	to the base class rather than to the (non-existant) derived class.
> 
> compiler/hlds_data.m:
> 	Add get_primary_tag, for use by ml_unify_gen.m.
> 


> Workspace: /home/earth/fjh/ws-earth3/mercury
> Index: compiler/hlds_data.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/hlds_data.m,v
> retrieving revision 1.60
> diff -u -d -r1.60 hlds_data.m
> --- compiler/hlds_data.m	31 Oct 2001 16:58:08 -0000	1.60
> +++ compiler/hlds_data.m	4 Nov 2001 08:31:37 -0000
> @@ -444,10 +444,38 @@
>  :- type no_tag_type_table == map(type_id, no_tag_type).
>  
>  
> +	% Return the primary tag, if any, for a cons_tag.
> +	% A return value of `no' means the primary tag is unknown.
> +	% A return value of `yes(0)' means the primary tag is always zero.
> +:- func get_primary_tag(cons_tag) = maybe(int).
> +

I'm unclear on what "always zero" means.  Either "always" is redundant
or I am misunderstanding what this mean.

Why special case `yes(0)' in this documentation?

Apart from this comment, the change seems fine.

-- 
       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