Restoring of cost centre in let-no-escape: we need to do this after
binding the args to stack locations, otherwise we end up grabbing the
wrong slot.
Should hopefully fix profiling crashes. We still don't pay any
attention to the cost centre attached to the let-no-escape binding
itself, which looks wrong, but I don't intend to do anything about
that right now.
%
% (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
%
%
% (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
%
-% $Id: CgLetNoEscape.lhs,v 1.22 2003/07/02 13:19:29 simonpj Exp $
+% $Id: CgLetNoEscape.lhs,v 1.23 2003/07/18 16:31:27 simonmar Exp $
%
%********************************************************
%* *
%
%********************************************************
%* *
(deAllocStackTop retPrimRepSize `thenFC` \_ ->
forkAbsC (
(deAllocStackTop retPrimRepSize `thenFC` \_ ->
forkAbsC (
- restoreCurrentCostCentre cc_slot `thenC`
- cgLetNoEscapeBody bndr cc args body
+ cgLetNoEscapeBody bndr cc cc_slot args body
) `thenFC` \ abs_c ->
mkRetDirectTarget bndr abs_c srt
-- Ignore the label that comes back from
) `thenFC` \ abs_c ->
mkRetDirectTarget bndr abs_c srt
-- Ignore the label that comes back from
\begin{code}
cgLetNoEscapeBody :: Id -- Name of the joint point
-> CostCentreStack
\begin{code}
cgLetNoEscapeBody :: Id -- Name of the joint point
-> CostCentreStack
+ -> Maybe VirtualSpOffset
-> [Id] -- Args
-> StgExpr -- Body
-> Code
-> [Id] -- Args
-> StgExpr -- Body
-> Code
-cgLetNoEscapeBody bndr cc all_args body
+cgLetNoEscapeBody bndr cc cc_slot all_args body
= bindUnboxedTupleComponents all_args `thenFC` \ (arg_regs, ptrs, nptrs, ret_slot) ->
= bindUnboxedTupleComponents all_args `thenFC` \ (arg_regs, ptrs, nptrs, ret_slot) ->
+ -- restore the saved cost centre
+ restoreCurrentCostCentre cc_slot `thenC`
+
-- Enter the closures cc, if required
--enterCostCentreCode closure_info cc IsFunction `thenC`
-- Enter the closures cc, if required
--enterCostCentreCode closure_info cc IsFunction `thenC`