[Git][ghc/ghc][wip/decode_cloned_stack] Remove unnecessary instances
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Fri Mar 31 13:38:51 UTC 2023
Sven Tennie pushed to branch wip/decode_cloned_stack at Glasgow Haskell Compiler / GHC
Commits:
1f07b283 by Sven Tennie at 2023-03-31T13:37:00+00:00
Remove unnecessary instances
- - - - -
2 changed files:
- libraries/base/GHC/Stack/CloneStack.hs
- libraries/base/cbits/StackCloningDecoding.cmm
Changes:
=====================================
libraries/base/GHC/Stack/CloneStack.hs
=====================================
@@ -19,47 +19,29 @@ module GHC.Stack.CloneStack (
StackEntry(..),
cloneMyStack,
cloneThreadStack,
- decode,
- stackSnapshotToString
+ decode
) where
import Control.Concurrent.MVar
import Data.Maybe (catMaybes)
import Foreign
import GHC.Conc.Sync
-import GHC.Exts (Int (I#), RealWorld, StackSnapshot#, ThreadId#, Array#, sizeofArray#, indexArray#, State#, StablePtr#, Word#, unsafeCoerce#)
+import GHC.Exts (Int (I#), RealWorld, StackSnapshot#, ThreadId#, Array#, sizeofArray#, indexArray#, State#, StablePtr#)
import GHC.IO (IO (..))
import GHC.InfoProv (InfoProv (..), InfoProvEnt, ipLoc, ipeProv, peekInfoProv)
import GHC.Stable
-import GHC.Word
-import Numeric
-- | A frozen snapshot of the state of an execution stack.
--
-- @since 4.17.0.0
data StackSnapshot = StackSnapshot !StackSnapshot#
-instance Show StackSnapshot where
- showsPrec _ stack rs =
- "StackSnapshot(" ++ stackSnapshotToString stack ++ ")" ++ rs
-
-stackSnapshotToString :: StackSnapshot -> String
-stackSnapshotToString (StackSnapshot s#) = pad_out (showHex addr "")
- where
- addr = W# (unsafeCoerce# s#)
- pad_out ls = '0':'x':ls
-
-instance Eq StackSnapshot where
- (StackSnapshot s1#) == (StackSnapshot s2#) = (W# (eqStacks# s1# s2#)) > 0
-
foreign import prim "stg_decodeStackzh" decodeStack# :: StackSnapshot# -> State# RealWorld -> (# State# RealWorld, Array# (Ptr InfoProvEnt) #)
foreign import prim "stg_cloneMyStackzh" cloneMyStack# :: State# RealWorld -> (# State# RealWorld, StackSnapshot# #)
foreign import prim "stg_sendCloneStackMessagezh" sendCloneStackMessage# :: ThreadId# -> StablePtr# PrimMVar -> State# RealWorld -> (# State# RealWorld, (# #) #)
-foreign import prim "eqStackszh" eqStacks# :: StackSnapshot# -> StackSnapshot# -> Word#
-
{-
Note [Stack Cloning]
~~~~~~~~~~~~~~~~~~~~
=====================================
libraries/base/cbits/StackCloningDecoding.cmm
=====================================
@@ -24,7 +24,3 @@ stg_decodeStackzh (gcptr stgStack) {
return (stackEntries);
}
-
-eqStackszh(P_ stack1, P_ stack2) {
- return (stack1 == stack2);
-}
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f07b2836603e11324171cc0b37b9b52423aca4f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1f07b2836603e11324171cc0b37b9b52423aca4f
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/20230331/9f198eab/attachment-0001.html>
More information about the ghc-commits
mailing list