summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Tennie <sven.tennie@gmail.com>2023-04-09 09:16:47 +0000
committerSven Tennie <sven.tennie@gmail.com>2023-05-05 19:59:53 +0000
commit5d015c94355b017ceea4f2b759d6650b22b5532f (patch)
treec125fc20925d3bdcb950a74c4369bef2e90d2155
parent9306ac1f1d452ea5be9a9b18319cd85edfa91908 (diff)
downloadhaskell-5d015c94355b017ceea4f2b759d6650b22b5532f.tar.gz
decodeBitmaps: One offset is enough
-rw-r--r--libraries/ghc-heap/GHC/Exts/Stack/Decode.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs b/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
index 3d06efaac8..a46f2f1b9b 100644
--- a/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
+++ b/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
@@ -225,7 +225,7 @@ decodeLargeBitmap getterFun# stackSnapshot# index relativePayloadOffset = do
case getterFun# stackSnapshot# (wordOffsetToWord# index) s of
(# s1, ba#, s# #) -> (# s1, (ByteArray ba#, W# s#) #)
let bitmapWords :: [Word] = byteArrayToList bitmapArray
- decodeBitmaps stackSnapshot# index relativePayloadOffset bitmapWords size
+ decodeBitmaps stackSnapshot# (index + relativePayloadOffset) bitmapWords size
where
byteArrayToList :: ByteArray -> [Word]
byteArrayToList (ByteArray bArray) = go 0
@@ -238,9 +238,9 @@ decodeLargeBitmap getterFun# stackSnapshot# index relativePayloadOffset = do
sizeofByteArray :: ByteArray# -> Int
sizeofByteArray arr# = I# (sizeofByteArray# arr#)
-decodeBitmaps :: StackSnapshot# -> WordOffset -> WordOffset -> [Word] -> Word -> IO [Closure]
-decodeBitmaps stackSnapshot# index relativePayloadOffset bitmapWords size =
- let bes = wordsToBitmapEntries (index + relativePayloadOffset) bitmapWords size
+decodeBitmaps :: StackSnapshot# -> WordOffset -> [Word] -> Word -> IO [Closure]
+decodeBitmaps stackSnapshot# index bitmapWords size =
+ let bes = wordsToBitmapEntries index bitmapWords size
in mapM toBitmapPayload bes
where
toBitmapPayload :: StackFrameIter -> IO Closure
@@ -295,7 +295,7 @@ decodeSmallBitmap getterFun# stackSnapshot# index relativePayloadOffset =
case getterFun# stackSnapshot# (wordOffsetToWord# index) s of
(# s1, b#, s# #) -> (# s1, (W# b#, W# s#) #)
let bitmapWords = [bitmap | size > 0]
- decodeBitmaps stackSnapshot# index relativePayloadOffset bitmapWords size
+ decodeBitmaps stackSnapshot# (index + relativePayloadOffset) bitmapWords size
unpackStackFrame :: StackFrameLocation -> IO StackFrame
unpackStackFrame ((StackSnapshot stackSnapshot#), index) = do