[m-dev.] for review: --call-trace-struct

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Thu Apr 29 15:44:32 AEST 1999


Zoltan Somogyi writes:
> 
> 
> Estimated hours taken: 10
> 
> Add an option that causes the compiler to pass information to the
> execution tracing system in one struct, rather than four separate arguments.
> 
...

> compiler/hlds_pred.m:
> 	Add a new field to the global_data data structure to hold this data.

This change is to hlds_module, not hlds_pred.


> compiler/llds_out.m:
> 	Add code to print the new kind of comp_gen_c_data.
> 
> 	Move the code to print trace_ports from trace.m toi here.

s/toi/to/

> Index: compiler/code_info.m
> ===================================================================

> @@ -894,11 +932,11 @@
>  code_info__reset_to_position(position_info(PosCI), CurCI, NextCI) :-
>  		% The static fields in PosCI and CurCI should be identical.
>  	PosCI  = code_info(_,  _,  _,  _,  _,  _,  _,  _, 
> -		LA, LB, LC, LD, LE, LF, _,  _,  _,  _,  _,  _ ),
> +		LA, LB, LC, LD, LE, LF, _,  _,  _,  _,  _,  _,  _ ),

Why not fix the unusual spacing after the last argument?


> Index: compiler/trace.m
> ===================================================================


> +	;
> +		{
> +		Quote = """",
> +		Comma = ", ",
> +		llds_out__trace_port_to_string(Port, PortStr),
>  	string__int_to_string(MaxReg, MaxRegStr),
>  	string__append_list([
>  		"\t\tMR_jumpaddr = MR_trace(\n",
> @@ -515,8 +518,11 @@
>  		"\t\t\t&mercury_data__layout__", LabelStr, Comma, "\n",
>  		"\t\t\t", PortStr, Comma, Quote, PathStr, Quote, Comma,
>  		MaxRegStr, ");\n"],
> -		CallStmt),
> -	GotoStmt = "\t\tif (MR_jumpaddr != NULL) GOTO(MR_jumpaddr);",
> +			CallStmt)
> +		}
> +	),
> +	code_info__add_trace_layout_for_label(Label, LayoutLabelInfo),
> +	{
>  	string__append_list([DeclStmt, SaveStmt, CallStmt, RestoreStmt,
>  		GotoStmt], TraceStmt),
>  	TraceCode =
> @@ -535,8 +541,7 @@
>  				- ""
>  		]),
>  	Code = tree(ProduceCode, TraceCode)
> -	},
> -	code_info__add_trace_layout_for_label(Label, LayoutLabelInfo).
> +	}.
>  

The indentation appears inconsistent, although it is hard to tell
from the diff.  If this is the case, please fix it.


> Index: runtime/mercury_trace_base.c
> ===================================================================

> +/*
> +** This structure is only used by MR_do_trace_redo_fail.
> +** Every call to MR_trace_struct from MR_do_trace_redo_fail will set the
> +** label layout field to the value it finds in the stack slot reserved
> +** for this purpose. The other three fields ("", 0, and MR_PORT_REDO)
> +** are the same for all calls to MR_trace_struct from here.
> +*/
> +
> +static	MR_Trace_Call_Info	MR_retry_trace_call_info =
> +					{
> +						NULL,
> +						"",
> +						0,
> +						MR_PORT_REDO
> +					};
> +
>  Define_extern_entry(MR_do_trace_redo_fail);
>  
>  BEGIN_MODULE(MR_trace_labels_module)
> @@ -307,12 +397,15 @@
>  	*/
>  	{
>  		Code *MR_jumpaddr;
> +		MR_retry_trace_call_info.MR_trace_sll = 
> +			(const MR_Stack_Layout_Label *)
> +			MR_redo_layout_framevar(MR_redofr_slot(MR_curfr));
>  		save_transient_registers();
> -		MR_jumpaddr = MR_trace((const MR_Stack_Layout_Label *)
> -			MR_redo_layout_framevar(MR_redofr_slot(MR_curfr)),
> -			MR_PORT_REDO, "", 0);
> +		MR_jumpaddr = MR_trace_struct(&MR_retry_trace_call_info);
>  		restore_transient_registers();

That change probably warrants a mention in the log message.

Other than that I see no problems.

Cheers,
Mark.
-- 
Mark Brown  (dougl at cs.mu.oz.au)       )O+   |  For Microsoft to win,
MEngSc student,                             |  the customer must lose
Dept of Computer Science, Melbourne Uni     |          -- Eric S. Raymond
--------------------------------------------------------------------------
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