[m-dev.] diff: Compiler support for stack_layouts

Fergus Henderson fjh at cs.mu.oz.au
Tue Dec 9 21:48:05 AEDT 1997


On 27-Oct-1997, Tyson Richard DOWD <trd at cs.mu.oz.au> wrote:
   ^^^^^^^^^^^

> This diff is the compiler support for stack layouts. 

This has been lying around in my "in tray" for a while...
long enough, in fact, that I can't even recall whether or not I've
already reviewed it.  But anyway, here goes...

> -	% Pseudo-typeinfos are just like typeinfos, but can also
> -	% store type variables. We store type variables as integers,
> -	% which will always have low values.

These comments are useful, I think, and so perhaps they should be moved
somewhere appropriate rather than deleted?

>  :- module continuation_info.
>  
>  :- interface.
>  
> -:- import_module list, llds.
> +:- import_module list, llds, hlds_pred.

Please keep the lists of library modules and compiler modules separate.

> +	%
> +	% Add a the info for this proc (an entry_layout) to the
> +	% continuation_info.
> +	%

s/a the/the/

> +continuation_info__add_non_continuation_labels(Labels) -->
> +	continuation_info__get_internal_info(InternalInfo0),
> +	{ list__foldl(continuation_info__maybe_add_label, Labels, InternalInfo0, InternalInfo) },

Wrap this line.

> --- handle_options.m	1997/10/16 04:59:09	1.34
> +++ handle_options.m	1997/10/23 00:15:32
> @@ -525,7 +525,8 @@
>  	% 'accurate' is now set in the grade, so we can override it here.
>  	( 
>  		{ GC = accurate }, 
> -		set_string_opt(gc, "accurate") 
> +		set_string_opt(gc, "accurate"), 
> +		set_bool_opt(stack_layout, yes) 

Please add a comment "`--gc accurate' implies `--stack-layout'"
or "we need stack layouts for accurate gc" or something like that.

> diff -u -r1.211 llds.m
> --- llds.m	1997/10/12 13:32:31	1.211
> +++ llds.m	1997/10/21 01:54:18
> @@ -75,6 +75,7 @@
>  			string,			% predicate name
>  			int,			% arity
>  			llds_proc_id,		% mode number
> +			pred_proc_id,		% the pred_proc_id this code
>  			list(instruction)	% the code for this procedure

I don't understand -- why do you have both the pred_proc_id
and also the llds_proc_id?  Doesn't the pred_proc_id include the
llds_proc_id?

options.m:
> +	io__write_string("\t--stack-layout\n"),
> +	io__write_string("\t(This option is not for general use.)\n"),
> +	io__write_string("\t\tGenerate stack_layout structures.\n"),

Did you document this in user_guide.texi?

Is this option actually useful -- that is, would it ever make
sense to enable stack layouts when not doing accurate gc,
or to enable accurate gc but disable stack layouts?
If not, it would be better to not document it; the option
can remain, but you should document in options.m that it is
for internal use only and delete the entry for it from the
`long_options' list so that it can't be used.

Apart from the above, it looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list