From cb43dfcd86ff1904bd70bf355f1658eb66489842 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 7 Jan 2003 14:31:20 +0000 Subject: [PATCH] [project @ 2003-01-07 14:31:19 by simonmar] Update comments --- ghc/compiler/codeGen/CgBindery.lhs | 14 +++----------- ghc/compiler/codeGen/CgMonad.lhs | 10 +++++++++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ghc/compiler/codeGen/CgBindery.lhs b/ghc/compiler/codeGen/CgBindery.lhs index 8e1a9fd..edfe45e 100644 --- a/ghc/compiler/codeGen/CgBindery.lhs +++ b/ghc/compiler/codeGen/CgBindery.lhs @@ -435,17 +435,9 @@ There are four kinds of things on the stack: - free slots (recorded in the stack free list) - non-pointer data slots (recorded in the stack free list) -We build up a bitmap of non-pointer slots by looking down the -environment for all the non-pointer variables, and merging this with -the slots recorded in the stack free list. - -There's a bit of a hack here to do with update frames: since nothing -is recorded in either the environment or the stack free list for an -update frame, the code below defaults to assuming the slots taken up -by an update frame contain pointers. Furthermore, update frames are -always in slots 0-2 at the bottom of the stack. The bitmap will -therefore end at slot 3, which is what we want (the update frame info -pointer has its own bitmap to describe the update frame). +We build up a bitmap of non-pointer slots by searching the environment +for all the pointer variables, and subtracting these from a bitmap +with initially all bits set (up to the size of the stack frame). \begin{code} buildLivenessMask diff --git a/ghc/compiler/codeGen/CgMonad.lhs b/ghc/compiler/codeGen/CgMonad.lhs index 2a7e3ea..a14b77a 100644 --- a/ghc/compiler/codeGen/CgMonad.lhs +++ b/ghc/compiler/codeGen/CgMonad.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgMonad.lhs,v 1.36 2002/12/11 15:36:26 simonmar Exp $ +% $Id: CgMonad.lhs,v 1.37 2003/01/07 14:31:20 simonmar Exp $ % \section[CgMonad]{The code generation monad} @@ -206,6 +206,14 @@ type StackUsage = Int, -- realSp: Virtual offset of real stack pointer Int) -- hwSp: Highest value ever taken by virtSp +-- ToDo (SDM, 7 Jan 2003): I'm not sure that the distinction between +-- Free and NonPointer in the free list is needed any more. It used +-- to be needed because we constructed bitmaps from the free list, but +-- now we construct bitmaps by finding all the live pointer bindings +-- instead. Non-pointer stack slots (i.e. saved cost centres) can +-- just be removed from the free list instead of being recorded as a +-- NonPointer. + type HeapUsage = (HeapOffset, -- virtHp: Virtual offset of highest-allocated word HeapOffset) -- realHp: Virtual offset of real heap ptr -- 1.7.10.4