diff options
| author | Sven Tennie <sven.tennie@gmail.com> | 2023-04-23 08:53:15 +0000 |
|---|---|---|
| committer | Sven Tennie <sven.tennie@gmail.com> | 2023-05-05 19:59:53 +0000 |
| commit | ecab67057c43697891fc056d9ddc540b387be5d3 (patch) | |
| tree | e6bc93bd740a46c545b6f15b245d3a3386bb722e | |
| parent | e83bba0d830ac18ed9df6f98979b5da6d20bf992 (diff) | |
| download | haskell-ecab67057c43697891fc056d9ddc540b387be5d3.tar.gz | |
Simplify stackHead
| -rw-r--r-- | libraries/ghc-heap/GHC/Exts/Stack/Decode.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs b/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs index 13d89f8bc8..218302cd23 100644 --- a/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs +++ b/libraries/ghc-heap/GHC/Exts/Stack/Decode.hs @@ -205,8 +205,8 @@ getStackFields stackSnapshot# = IO $ \s -> (# s1, (W32# sSize#, W8# sDirty#, W8# sMarking#) #) -- | `StackFrameLocation` of the top-most stack frame -stackHead :: StackSnapshot -> StackFrameLocation -stackHead (StackSnapshot s#) = (StackSnapshot s#, 0) -- GHC stacks are never empty +stackHead :: StackSnapshot# -> StackFrameLocation +stackHead s# = (StackSnapshot s#, 0) -- GHC stacks are never empty -- | Advance to the next stack frame (if any) -- @@ -444,7 +444,7 @@ decodeStack (StackSnapshot stack#) = do (stack_size', stack_dirty', stack_marking') <- getStackFields stack# case tipe info of STACK -> do - let sfls = stackFrameLocations (StackSnapshot stack#) + let sfls = stackFrameLocations stack# stack' <- mapM unpackStackFrame sfls pure $ StgStackClosure @@ -456,10 +456,10 @@ decodeStack (StackSnapshot stack#) = do } _ -> error $ "Expected STACK closure, got " ++ show info where - stackFrameLocations :: StackSnapshot -> [StackFrameLocation] - stackFrameLocations s = - stackHead s - : go (advanceStackFrameLocation (stackHead s)) + stackFrameLocations :: StackSnapshot# -> [StackFrameLocation] + stackFrameLocations s# = + stackHead s# + : go (advanceStackFrameLocation (stackHead s#)) where go :: Maybe StackFrameLocation -> [StackFrameLocation] go Nothing = [] |
