diff options
author | simonpj <unknown> | 2001-09-26 15:11:51 +0000 |
---|---|---|
committer | simonpj <unknown> | 2001-09-26 15:11:51 +0000 |
commit | 5cd3527da623a25b9ace2995f9d2e7f6c90c611f (patch) | |
tree | 85ea7dfbca2c214fd4485d6952bd3714698ca601 /ghc/compiler/codeGen/CgLetNoEscape.lhs | |
parent | 03aa2ef64390090c64d0fcf81b1050a9f3a4a452 (diff) | |
download | haskell-5cd3527da623a25b9ace2995f9d2e7f6c90c611f.tar.gz |
[project @ 2001-09-26 15:11:50 by simonpj]
-------------------------------
Code generation and SRT hygiene
-------------------------------
This is a big tidy up commit. I don't think it breaks anything,
but it certainly makes the code clearer (to me).
I'm not certain that you can use it without sucking in my other
big commit... they come from the same tree.
Core-to-STG, live variables and Static Reference Tables (SRTs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I did a big tidy-up of the live-variable computation in CoreToStg.
The key idea is that the live variables consist of two parts:
dynamic live vars
static live vars (CAFs)
These two always travel round together, but they were always
treated separately by the code until now. Now it's a new data type:
type LiveInfo = (StgLiveVars, -- Dynamic live variables;
-- i.e. ones with a nested (non-top-level) binding
CafSet) -- Static live variables;
-- i.e. top-level variables that are CAFs or refer to them
There's lots of documentation in CoreToStg.
Code generation
~~~~~~~~~~~~~~~
Arising from this, I found that SRT labels were stored in
a LambdaFormInfo during code generation, whereas they *ought*
to be in the ClosureInfo (which in turn contains a LambdaFormInfo).
This led to lots of changes in ClosureInfo, and I took the opportunity
to make it into a labelled record.
Similarly, I made the data type in AbstractC a bit more explicit:
-- C_SRT is what StgSyn.SRT gets translated to...
-- we add a label for the table, and expect only the 'offset/length' form
data C_SRT = NoC_SRT
| C_SRT CLabel !Int{-offset-} !Int{-length-}
(Previously there were bottoms lying around.)
Diffstat (limited to 'ghc/compiler/codeGen/CgLetNoEscape.lhs')
-rw-r--r-- | ghc/compiler/codeGen/CgLetNoEscape.lhs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ghc/compiler/codeGen/CgLetNoEscape.lhs b/ghc/compiler/codeGen/CgLetNoEscape.lhs index 07cacd4841..a5b0a20d8b 100644 --- a/ghc/compiler/codeGen/CgLetNoEscape.lhs +++ b/ghc/compiler/codeGen/CgLetNoEscape.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP/AQUA Project, Glasgow University, 1993-1998 % -% $Id: CgLetNoEscape.lhs,v 1.14 2000/07/11 16:03:37 simonmar Exp $ +% $Id: CgLetNoEscape.lhs,v 1.15 2001/09/26 15:11:50 simonpj Exp $ % %******************************************************** %* * @@ -170,12 +170,12 @@ cgLetNoEscapeClosure (allocStackTop retPrimRepSize `thenFC` \_ -> nukeDeadBindings full_live_in_rhss) - (deAllocStackTop retPrimRepSize `thenFC` \_ -> - buildContLivenessMask uniq `thenFC` \ liveness -> + (deAllocStackTop retPrimRepSize `thenFC` \_ -> + buildContLivenessMask uniq `thenFC` \ liveness -> forkAbsC (cgLetNoEscapeBody binder cc args body uniq) `thenFC` \ code -> - getSRTLabel `thenFC` \ srt_label -> - absC (CRetDirect uniq code (srt_label,srt) liveness) + getSRTInfo srt `thenFC` \ srt_info -> + absC (CRetDirect uniq code srt_info liveness) `thenC` returnFC ()) `thenFC` \ (vSp, _) -> |