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

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Oct 25 14:21:43 AEST 2001


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.

> +:- 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.

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

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