Commit a6e9efb2 authored by simonmar's avatar simonmar
Browse files

[project @ 2003-07-18 16:31:27 by simonmar]

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.
parent 7ede37c9
%
% (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 $
%
%********************************************************
%* *
......@@ -167,8 +167,7 @@ cgLetNoEscapeClosure
(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
......@@ -181,13 +180,17 @@ cgLetNoEscapeClosure
\begin{code}
cgLetNoEscapeBody :: Id -- Name of the joint point
-> CostCentreStack
-> Maybe VirtualSpOffset
-> [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) ->
-- restore the saved cost centre
restoreCurrentCostCentre cc_slot `thenC`
-- Enter the closures cc, if required
--enterCostCentreCode closure_info cc IsFunction `thenC`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment