[m-rev.] diff: Remove unnecessary goal_path field from call_site_perf structure.

Paul Bone pbone at csse.unimelb.edu.au
Sun Oct 5 17:25:16 AEDT 2008


Estimated hours taken: 0.5
Branches: main

Remove the goal path field from from the call_site_perf structure since it's
superfluous.

deep_profiler/report.m:
    As above.
    Make the goal_path field in the call_site_desc structure store a goal path
    rather than a string representing one.

deep_profiler/create_report.m:
deep_profiler/display_report.m:
    Conform to changes in report.m

Index: deep_profiler/create_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/create_report.m,v
retrieving revision 1.12
diff -u -p -b -r1.12 create_report.m
--- deep_profiler/create_report.m	3 Oct 2008 07:39:04 -0000	1.12
+++ deep_profiler/create_report.m	5 Oct 2008 06:12:15 -0000
@@ -617,13 +617,6 @@ create_call_site_summary(Deep, CSSPtr) =
     deep_lookup_call_site_statics(Deep, CSSPtr, CSS),
     KindAndCallee = CSS ^ css_kind,
     CallerPSPtr = CSS ^ css_container,
-    GoalPathString = CSS ^ css_goal_path,
-    ( goal_path_from_string(GoalPathString, GoalPathPrime) ->
-        GoalPath = GoalPathPrime
-    ;
-        error("create_call_site_summary: " ++
-            "Couldn't convert string to goal path: " ++ GoalPathString)
-    ),
 
     deep_lookup_call_site_calls(Deep, CSSPtr, CallSiteCallMap),
     map.to_assoc_list(CallSiteCallMap, CallSiteCalls),
@@ -675,8 +668,7 @@ create_call_site_summary(Deep, CSSPtr) =
         own_and_inherit_to_perf_row_data(Deep, CallSiteDesc, SumOwn, SumDesc,
             SummaryRowData)
     ),
-    CallSitePerf = call_site_perf(KindAndInfo, SummaryRowData, SubRowDatas,
-        GoalPath).
+    CallSitePerf = call_site_perf(KindAndInfo, SummaryRowData, SubRowDatas).
 
 :- type call_site_callee_perf
     --->    call_site_callee_perf(
@@ -910,7 +902,8 @@ generate_procrep_coverage_dump_report(De
 
 create_cs_summary_add_to_map(Deep, CSStatic, Map0) = Map :-
     create_call_site_summary(Deep, CSStatic) = CSSummary,
-    GoalPath = CSSummary ^ csf_goal_path,
+    GoalPath = CSSummary ^ csf_summary_perf ^ perf_row_subject 
+        ^ csdesc_goal_path,
     map.det_insert(Map0, GoalPath, CSSummary, Map).
 
 :- pred add_coverage_point_to_map(coverage_point::in,
@@ -1189,17 +1182,18 @@ describe_call_site(Deep, CSSPtr) = CallS
     ( valid_call_site_static_ptr(Deep, CSSPtr) ->
         deep_lookup_call_site_statics(Deep, CSSPtr, CSS),
         CSS = call_site_static(ContainingPSPtr, SlotNumber, _Kind, LineNumber,
-            GoalPath),
+            GoalPathString),
         deep_lookup_proc_statics(Deep, ContainingPSPtr, ContainingPS),
         FileName = ContainingPS ^ ps_file_name,
-        RefinedName = ContainingPS ^ ps_refined_id
+        RefinedName = ContainingPS ^ ps_refined_id,
+        goal_path_from_string_det(GoalPathString, GoalPath)
     ;
         ContainingPSPtr = dummy_proc_static_ptr,
         FileName = "",
         LineNumber = 0,
         RefinedName = "mercury_runtime",
         SlotNumber = -1,
-        GoalPath = ""
+        GoalPath = empty_goal_path 
     ),
     CallSiteDesc = call_site_desc(CSSPtr, ContainingPSPtr,
         FileName, LineNumber, RefinedName, SlotNumber, GoalPath).
Index: deep_profiler/display_report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/display_report.m,v
retrieving revision 1.14
diff -u -p -b -r1.14 display_report.m
--- deep_profiler/display_report.m	3 Oct 2008 06:57:15 -0000	1.14
+++ deep_profiler/display_report.m	5 Oct 2008 06:12:15 -0000
@@ -844,7 +844,7 @@ display_report_proc(Prefs, ProcReport, D
 
 report_proc_call_site(Prefs, CallSitePerf) = Rows :-
     CallSitePerf =
-        call_site_perf(KindAndCallee, SummaryPerfRowData, SubPerfs0, _),
+        call_site_perf(KindAndCallee, SummaryPerfRowData, SubPerfs0),
 
     CallSiteDesc = SummaryPerfRowData ^ perf_row_subject,
     ContextCell = call_site_desc_source_cell(CallSiteDesc),
@@ -3250,8 +3250,9 @@ proc_desc_to_prefix_proc_name_cell(Prefs
 call_site_desc_to_name_path_slot_cell(Prefs, CallSiteDesc) = Cell :-
     CallSiteDesc = call_site_desc(CSSPtr, _ContainerPSPtr,
         _FileName, _LineNumber, RefinedName, SlotNumber, GoalPath),
-    string.format("%s @ %s #%d", [s(RefinedName), s(GoalPath), i(SlotNumber)],
-        Name),
+    GoalPathStr = goal_path_to_string(GoalPath),
+    string.format("%s @ %s #%d", 
+        [s(RefinedName), s(GoalPathStr), i(SlotNumber)], Name),
     Cmd = deep_cmd_dump_call_site_static(CSSPtr),
     Link = deep_link(Cmd, yes(Prefs), attr_str([], Name), link_class_link),
     Cell = table_cell(td_l(Link)).
Index: deep_profiler/report.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/report.m,v
retrieving revision 1.12
diff -u -p -b -r1.12 report.m
--- deep_profiler/report.m	3 Oct 2008 06:57:15 -0000	1.12
+++ deep_profiler/report.m	5 Oct 2008 06:12:15 -0000
@@ -189,8 +189,7 @@
                 csf_kind                    :: call_site_kind_and_info(
                                                 normal_callee_id),
                 csf_summary_perf            :: perf_row_data(call_site_desc),
-                csf_sub_callees             :: list(perf_row_data(proc_desc)),
-                csf_goal_path               :: goal_path
+                csf_sub_callees             :: list(perf_row_data(proc_desc))
             ).
 
 :- type normal_callee_id
@@ -417,7 +416,7 @@
                 csdesc_line_number          :: int,
                 csdesc_caller_refined_name  :: string,
                 csdesc_slot_number          :: int,
-                csdesc_goal_path            :: string
+                csdesc_goal_path            :: goal_path 
             ).
 
 :- type ancestor_desc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20081005/8020c522/attachment.sig>


More information about the reviews mailing list