[Git][ghc/ghc][wip/decode_cloned_stack] Update pragmas
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Sat Feb 18 16:19:00 UTC 2023
Sven Tennie pushed to branch wip/decode_cloned_stack at Glasgow Haskell Compiler / GHC
Commits:
bab63f7f by Sven Tennie at 2023-02-18T16:18:34+00:00
Update pragmas
- - - - -
4 changed files:
- libraries/ghc-heap/GHC/Exts/Heap.hs
- libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
- libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc
- libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
Changes:
=====================================
libraries/ghc-heap/GHC/Exts/Heap.hs
=====================================
@@ -7,7 +7,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
{-# LANGUAGE RecordWildCards #-}
#endif
{-# LANGUAGE UnliftedFFITypes #-}
@@ -78,7 +78,7 @@ import GHC.Exts.Heap.Decode
import GHC.Exts
import GHC.Int
import GHC.Word
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
import GHC.Stack.CloneStack
import GHC.Exts.Stack.Decode
import GHC.Exts.Stack.Constants
@@ -140,7 +140,7 @@ instance Double# ~ a => HasHeapRep (a :: TYPE 'DoubleRep) where
getClosureData x = return $
DoubleClosure { ptipe = PDouble, doubleVal = D# x }
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
instance {-# OVERLAPPING #-} HasHeapRep StackSnapshot# where
getClosureData s# = decodeStack (StackSnapshot s#)
#endif
@@ -183,7 +183,7 @@ getClosureDataFromHeapObject x = do
getBoxedClosureData :: Box -> IO Closure
getBoxedClosureData (Box a) = getClosureData a
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
getBoxedClosureData b@(StackFrameBox sfi) = trace ("unpack " ++ show b) $ unpackStackFrameIter sfi
#endif
@@ -193,7 +193,7 @@ getBoxedClosureData b@(StackFrameBox sfi) = trace ("unpack " ++ show b) $ unpack
-- @since 8.10.1
closureSize :: Box -> IO Int
closureSize (Box x) = pure $ I# (closureSize# x)
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
closureSize (StackFrameBox sfi) = unpackStackFrameIter sfi <&>
\c ->
case c of
=====================================
libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
=====================================
@@ -24,7 +24,7 @@ module GHC.Exts.Heap.Closures (
, Box(..)
, areBoxesEqual
, asBox
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
, StackFrameIter(..)
#endif
) where
@@ -53,7 +53,7 @@ import GHC.Exts
import GHC.Generics
import Numeric
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
import GHC.Stack.CloneStack (StackSnapshot(..), stackSnapshotToString)
import GHC.Exts.Stack.Constants
#endif
@@ -66,7 +66,7 @@ foreign import prim "aToWordzh" aToWord# :: Any -> Word#
foreign import prim "reallyUnsafePtrEqualityUpToTag"
reallyUnsafePtrEqualityUpToTag# :: Any -> Any -> Int#
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
-- | Iterator state for stack decoding
data StackFrameIter =
-- | Represents a `StackClosure` / @StgStack@
@@ -134,7 +134,7 @@ instance Show Box where
tag = ptr .&. fromIntegral tAG_MASK -- ((1 `shiftL` TAG_BITS) -1)
addr = ptr - tag
pad_out ls = '0':'x':ls
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
showsPrec _ (StackFrameBox sfi) rs =
"(StackFrameBox " ++ show sfi ++ ")" ++ rs
#endif
@@ -145,7 +145,7 @@ areBoxesEqual :: Box -> Box -> IO Bool
areBoxesEqual (Box a) (Box b) = case reallyUnsafePtrEqualityUpToTag# a b of
0# -> pure False
_ -> pure True
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
areBoxesEqual (StackFrameBox sfi1) (StackFrameBox sfi2) =
pure $ sfi1 == sfi2
areBoxesEqual _ _ = pure False
@@ -376,7 +376,7 @@ data GenClosure b
, stack :: ![b]
}
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
| UpdateFrame
{ info :: !StgInfoTable
, knownUpdateFrameType :: !UpdateFrameType
@@ -628,7 +628,7 @@ allClosures (FunClosure {..}) = ptrArgs
allClosures (BlockingQueueClosure {..}) = [link, blackHole, owner, queue]
allClosures (WeakClosure {..}) = [cfinalizers, key, value, finalizer] ++ Data.Foldable.toList weakLink
allClosures (OtherClosure {..}) = hvalues
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
allClosures (StackClosure {..}) = stack
allClosures (UpdateFrame {..}) = [updatee]
allClosures (CatchFrame {..}) = [handler]
=====================================
libraries/ghc-heap/GHC/Exts/Stack/Constants.hsc
=====================================
@@ -4,7 +4,7 @@
module GHC.Exts.Stack.Constants where
-- TODO: Better expression to allow is only for the latest (this branch) GHC?
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
import Prelude
=====================================
libraries/ghc-heap/GHC/Exts/Stack/Decode.hs
=====================================
@@ -1,5 +1,5 @@
{-# LANGUAGE CPP #-}
-#if MIN_TOOL_VERSION_ghc(9,5,0)
+#if MIN_TOOL_VERSION_ghc(9,7,0)
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleInstances #-}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bab63f7f014e1ff0d5479506680c35e7386bdf0e
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bab63f7f014e1ff0d5479506680c35e7386bdf0e
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230218/ac0b87be/attachment-0001.html>
More information about the ghc-commits
mailing list