[m-rev.] for review: reserved address data representation (part 1)

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 25 22:28:05 AEST 2001


On 25-Oct-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 24-Oct-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > +	;       shared_with_reserved_addresses(list(reserved_address),
> > +				cons_tag).
> > +			% This is for constructors of discriminated union
> > +			% types where one or more of the *other* constructors
> > +			% for that type is represented
> > +			% as a null_pointer, small_pointer(int),
> > +			% or reserved_pointer(sym_name, arity).
> 
> Use "a discriminated union", and "are represented". "One or more" is vague;
> I expect that you intend that the list of reserved_address item should include
> the representations of *all* the other constructors with which this data item
> could be confused.
> 
> Listing all the alternatives of type reserved_address requires double
> maintenance.
>
> > +			% The reserved_values field specifies which.
> 
> I don't see a field with that name.

Sorry, I seem to have accidentally left those comments regarding the
reserved_address type in an incomplete and inconsistent mid-edit state.
I will modify the comments there to address all those issues you mentioned.

> > +:- type reserved_address
> > +	--->	null_pointer
> > +			% This is for constants which are represented as a
> > +			% null pointer.
> > +	;	small_pointer(int)
> > +			% This is for constants which are represented as a
> > +			% small integer, cast to a pointer.
> > +	;	reserved_object(type_id, sym_name, arity).
> > +			% This is for constants which are represented as the
> > +			% address of a specially reserved global variable.
> 
> I presume reserved_object is meant primarily for strongly typed backends;
> I don't expect to see too many types with enough alternatives to require
> their use in the C back end, given that we have more than a thousand small
> pointers.

Yes, that's correct.

Note that even the other (numeric) reserved addresses are not really very
useful for the C back-end; they are only used when --num-tag-bits is zero.

> Do you have preliminary performance figures for the impact of this change?

No, not yet.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  | "... it seems to me that 15 years of
The University of Melbourne         | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- Prof. Donald E. Knuth
--------------------------------------------------------------------------
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