[m-dev.] For review: Bytecode interpreter modification

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jan 18 15:32:46 AEDT 2001


On 18-Jan-2001, Levi Cameron <l.cameron2 at ugrad.unimelb.edu.au> wrote:
> 
> @@ -360,6 +353,10 @@
>  	proc_info_arg_info(ProcInfo, ArgInfo),
>  	assoc_list__from_corresponding_lists(ArgVars, ArgInfo, ArgVarsInfos),
>  
> +	module_info_preds(ModuleInfo, PredTable),
> +	map__lookup(PredTable, PredId, PredInfo),
> +	bytecode_gen__get_is_func(PredInfo, IsFunc),

That can be written more concisely as

	module_info_pred_info(ModuleInfo, PredId, PredInfo),
	bytecode_gen__get_is_func(PredInfo, IsFunc),

> @@ -669,9 +666,14 @@
>  		( EvalMethod = normal ->
>  			predicate_id(ModuleInfo, PredId,
>  				ModuleName, PredName, Arity),
> +
> +			module_info_preds(ModuleInfo, PredTable),
> +			map__lookup(PredTable, PredId, PredInfo),
> +			bytecode_gen__get_is_func(PredInfo, IsFunc),

Likewise.

> @@ -806,3 +808,14 @@
>  bytecode_gen__get_counts(byte_info(_, _, _, Label, Temp), Label, Temp).
>  
> 
> %---------------------------------------------------------------------------%
> +:- pred bytecode_gen__get_is_func(pred_info, byte_is_func).
> +:- mode bytecode_gen__get_is_func(in, out) is det.
> +
> +bytecode_gen__get_is_func(PredInfo, IsFunc) :-
> +	pred_info_get_is_pred_or_func(PredInfo, PredOrFunc),
> +	(PredOrFunc = predicate ->
> +		IsFunc = 0
> +	;
> +		IsFunc = 1
> +	).

Please put a space after the '(',
	( PredOrFunc = predicate ->
	 ^
and a blank line after the `%---...---%'.

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