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

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 24 17:28:58 AEST 2001


On 24-Oct-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 24-Oct-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > diff -u -d -r1.38 mercury_deep_copy_body.h
> > --- runtime/mercury_deep_copy_body.h	7 Aug 2001 23:12:25 -0000	1.38
> > +++ runtime/mercury_deep_copy_body.h	22 Oct 2001 12:12:53 -0000
> 
> >      case MR_TYPECTOR_REP_DU:
> >      case MR_TYPECTOR_REP_DU_USEREQ:
> > +    	du_type_layout = type_ctor_info->type_layout.layout_du;
> > +	/* fallthru */
> > +
> > +    du_type:
> >          {
> > -            MR_DuPtagLayout     *ptag_layout;
> > -            int                 ptag;
> >              MR_Word                *data_value;
> > +	    MR_DuPtagLayout     *ptag_layout;
> > +	    int                 ptag;
> >  
> >              ptag = MR_tag(data);
> > -            ptag_layout = &type_ctor_info->type_layout.layout_du[ptag];
> > +            ptag_layout = &du_type_layout[ptag];
> >  
> >              switch (ptag_layout->MR_sectag_locn) {
> >              case MR_SECTAG_LOCAL:
> 
> A comment explaining and highlighting the label there would improve
> mantainability.  If we are going to use gotos, we should be nice and
> clear about how the entry point works.

I've added the following comment before the label:

    /*
    ** This label handles both the DU case and the second half of the
    ** RESERVED_ADDR case.  `du_type_layout' must be set before
    ** this code is entered.
    */
    du_type:

> Ditto... Getting kinda boring now... All the other labels too!

Likewise, except that in one place the comment mentioned that `data'
needs to be set too.

I'll go ahead and commit this now.  I've already committed the other
parts of this change.

Note that reserved address data representations still won't be used
unless you explicitly set the appropriate options.  Eventually, when
I've tested it a bit more, we should enable this by default for the .NET
and Java back-ends, although we might need to improve the way we handle
switches for such types first.

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