summaryrefslogtreecommitdiff
path: root/ghc/compiler/codeGen/CgBindery.lhs
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-01-07 13:25:07 +0000
committersimonmar <unknown>2003-01-07 13:25:07 +0000
commitf70d008ec48679cba1a38e9979c47fb991cb075b (patch)
tree70c4f762e96004871f11b57045d05c13f14ac489 /ghc/compiler/codeGen/CgBindery.lhs
parentdff9bb4f02554f39d73faea100a35c2d1dd07556 (diff)
downloadhaskell-f70d008ec48679cba1a38e9979c47fb991cb075b.tar.gz
[project @ 2003-01-07 13:25:07 by simonmar]
Expand bitmaps to cover the full size of the stack frame. Previously the bitmap would stop at the last non-zero bit, which might shorten the bitmap by one or more words. The behaviour used to be correct, but with the eval/apply changes bitmaps must now cover the entire stack frame rather than everything up to the last non-pointer word.
Diffstat (limited to 'ghc/compiler/codeGen/CgBindery.lhs')
-rw-r--r--ghc/compiler/codeGen/CgBindery.lhs16
1 files changed, 12 insertions, 4 deletions
diff --git a/ghc/compiler/codeGen/CgBindery.lhs b/ghc/compiler/codeGen/CgBindery.lhs
index f2c32dc123..634b406932 100644
--- a/ghc/compiler/codeGen/CgBindery.lhs
+++ b/ghc/compiler/codeGen/CgBindery.lhs
@@ -514,11 +514,19 @@ buildContLivenessMask name = do
let lbl = mkBitmapLabel name
- -- realSp points to the frame-header for the current stack frame,
- -- and the end of this frame is frame_sp. The size is therefore
- -- realSp - frame_sp - 1 (subtract one for the frame-header).
frame_sp <- getStackFrame
- let liveness = Liveness lbl (realSp-1-frame_sp) mask
+ let
+ -- realSp points to the frame-header for the current stack frame,
+ -- and the end of this frame is frame_sp. The size is therefore
+ -- realSp - frame_sp - 1 (subtract one for the frame-header).
+ frame_size = realSp - frame_sp - 1
+
+ -- make sure the bitmap covers the full frame, by adding
+ -- zero words at the end as necessary
+ expand n [] = take ((n+31) `quot` 32) (repeat emptyBS)
+ expand n (b:bs) = b : expand (n-32) bs
+
+ liveness = Liveness lbl frame_size (expand frame_size mask)
absC (CBitmap liveness)
return liveness