[m-dev.] for review: cleanup of type_ctor_infos, part 0

Tyson Dowd trd at cs.mu.OZ.AU
Fri Feb 25 17:45:51 AEDT 2000


On 25-Feb-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> For review by Tyson.
> 
> The new data structures are not as compact as they could be. I have discussed
> some techniques for compressing tnem with Tyson, and will implement those
> techniques before this change is checked in, since this will avoid the
> otherwise onerous requirement for bootstrapping again, but I will make
> a relative diff available before then.
> 
> The diff to mercury_type_info.h is first, followed by the completely
> rewritten base_type_{info,layout}.m (the new code for those two modules
> is *way* smaller than their diffs).

> compiler/rtti.m:
> compiler/rtti_out.m:
> 	New files: rtti.m defines new types that allow us to construct
> 	Mercury representations of the C structures we want to emit,
> 	and rtti_out.m converts those representations to C definitions.
> 	These files are intended to be independent of whether the backend
> 	is LLDS or MLDS. At the moment, there are several vestiges that
> 	tie them to LLDS, mostly due to (a) the lack of a shared common
> 	infrastructure between llds_out.m and mlds_to_c.m, and (b)
> 	the continued use of the old representation of (pseudo-) typeinfos
> 	as rvals. These concerns will be addressed later.

s/later/in a future change/

> 
> compiler/llds.m:
> 	Update the definition of the comp_gen_c_data and data_addr types
> 	to account for the new RTTI structures.
> 
> compiler/llds_out.m:
> 	Update the code to output comp_gen_c_data and data_addr values
> 	to account for the new RTTI structures.
> 
> 	Make some parts of the code more modular, so that rtti_out.m
> 	can use what used to be selected parts of predicates.
> 
> 	Export several predicates for use by rtti_out.m. Some of these
> 	should later be moved to a file for infrastructure shared by
> 	llds_out.m and mlds_to_*.m. Others should be made internal again
> 	when the representation of typeinfos is made independent of the LLDS.
> 
> 	Rename some predicates to better reflect their purpose.
> 
> compiler/base_type_layout.m:
>         Complete rewrite for the new data structure; significantly smaller
> 	than before.
> 
> 	Now invoked from base_type_info for the types for which layout info
> 	is pertinent, whereas in the old design it was invoked from
> 	mercury_compile on all types, even types not defined in Mercury.

Might this be a good opportunity to rename this module?

>  /*
>  ** For now, we don't give a C definition of the structures of typeinfos
>  ** and pseudotypeinfos. We may change this later.
> +**
> +** A pseudotypeinfo is the same as a typeinfo (see polymorphism.m) but
> +** may also store free type variables, represented as small integers:
> +** 1 to 512 represent universally quantified type variables
> +** and 513 to 1024 represent existentially quantified type variables.
> +** (We do not use zero to, for two reasons. First, variable numbering

We do not use zero to what?

I don't have any problems with the rest of the C code in this part of
the diff (except the changes you have already foreshadowed with XXXs,
which we have discussed already and will be in the relative diff).

To be continued...

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list