{-# LANGUAGE CPP #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE GHCForeignImportPrim #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE UnliftedFFITypes #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveTraversable #-}
module GHC.Exts.Heap.Closures (
Closure
, GenClosure(..)
, PrimType(..)
, allClosures
#if __GLASGOW_HASKELL__ >= 809
, closureSize
#endif
, Box(..)
, areBoxesEqual
, asBox
) where
import Prelude
import GHC.Exts.Heap.Constants
#if defined(PROFILING)
import GHC.Exts.Heap.InfoTableProf
#else
import GHC.Exts.Heap.InfoTable
import GHC.Exts.Heap.InfoTableProf ()
#endif
import Data.Bits
import Data.Int
import Data.Word
import GHC.Exts
import GHC.Generics
import Numeric
foreign import prim "aToWordzh" aToWord# :: Any -> Word#
foreign import prim "reallyUnsafePtrEqualityUpToTag"
reallyUnsafePtrEqualityUpToTag# :: Any -> Any -> Int#
data Box = Box Any
instance Show Box where
showsPrec :: Int -> Box -> ShowS
showsPrec Int
_ (Box Any
a) String
rs =
ShowS
pad_out (Word -> ShowS
forall a. (Integral a, Show a) => a -> ShowS
showHex Word
addr String
"") String -> ShowS
forall a. [a] -> [a] -> [a]
++ (if Word
tagWord -> Word -> Bool
forall a. Ord a => a -> a -> Bool
>Word
0 then String
"/" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Word -> String
forall a. Show a => a -> String
show Word
tag else String
"") String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
rs
where
ptr :: Word
ptr = Word# -> Word
W# (Any -> Word#
aToWord# Any
a)
tag :: Word
tag = Word
ptr Word -> Word -> Word
forall a. Bits a => a -> a -> a
.&. Int -> Word
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
tAG_MASK
addr :: Word
addr = Word
ptr Word -> Word -> Word
forall a. Num a => a -> a -> a
- Word
tag
pad_out :: ShowS
pad_out String
ls = Char
'0'Char -> ShowS
forall a. a -> [a] -> [a]
:Char
'x'Char -> ShowS
forall a. a -> [a] -> [a]
:String
ls
asBox :: a -> Box
asBox :: a -> Box
asBox a
x = Any -> Box
Box (a -> Any
unsafeCoerce# a
x)
areBoxesEqual :: Box -> Box -> IO Bool
areBoxesEqual :: Box -> Box -> IO Bool
areBoxesEqual (Box Any
a) (Box Any
b) = case Any -> Any -> Int#
reallyUnsafePtrEqualityUpToTag# Any
a Any
b of
Int#
0# -> Bool -> IO Bool
forall (f :: * -> *) a. Applicative f => a -> f a
pure Bool
False
Int#
_ -> Bool -> IO Bool
forall (f :: * -> *) a. Applicative f => a -> f a
pure Bool
True
type Closure = GenClosure Box
data GenClosure b
=
ConstrClosure
{ GenClosure b -> StgInfoTable
info :: !StgInfoTable
, GenClosure b -> [b]
ptrArgs :: ![b]
, GenClosure b -> [Word]
dataArgs :: ![Word]
, GenClosure b -> String
pkg :: !String
, GenClosure b -> String
modl :: !String
, GenClosure b -> String
name :: !String
}
| FunClosure
{ info :: !StgInfoTable
, ptrArgs :: ![b]
, dataArgs :: ![Word]
}
| ThunkClosure
{ info :: !StgInfoTable
, ptrArgs :: ![b]
, dataArgs :: ![Word]
}
| SelectorClosure
{ info :: !StgInfoTable
, GenClosure b -> b
selectee :: !b
}
| PAPClosure
{ info :: !StgInfoTable
, GenClosure b -> HalfWord
arity :: !HalfWord
, GenClosure b -> HalfWord
n_args :: !HalfWord
, GenClosure b -> b
fun :: !b
, GenClosure b -> [b]
payload :: ![b]
}
| APClosure
{ info :: !StgInfoTable
, arity :: !HalfWord
, n_args :: !HalfWord
, fun :: !b
, payload :: ![b]
}
| APStackClosure
{ info :: !StgInfoTable
, fun :: !b
, payload :: ![b]
}
| IndClosure
{ info :: !StgInfoTable
, GenClosure b -> b
indirectee :: !b
}
| BCOClosure
{ info :: !StgInfoTable
, GenClosure b -> b
instrs :: !b
, GenClosure b -> b
literals :: !b
, GenClosure b -> b
bcoptrs :: !b
, arity :: !HalfWord
, GenClosure b -> HalfWord
size :: !HalfWord
, GenClosure b -> [Word]
bitmap :: ![Word]
}
| BlackholeClosure
{ info :: !StgInfoTable
, indirectee :: !b
}
| ArrWordsClosure
{ info :: !StgInfoTable
, GenClosure b -> Word
bytes :: !Word
, GenClosure b -> [Word]
arrWords :: ![Word]
}
| MutArrClosure
{ info :: !StgInfoTable
, GenClosure b -> Word
mccPtrs :: !Word
, GenClosure b -> Word
mccSize :: !Word
, GenClosure b -> [b]
mccPayload :: ![b]
}
| SmallMutArrClosure
{ info :: !StgInfoTable
, mccPtrs :: !Word
, mccPayload :: ![b]
}
| MVarClosure
{ info :: !StgInfoTable
, GenClosure b -> b
queueHead :: !b
, GenClosure b -> b
queueTail :: !b
, GenClosure b -> b
value :: !b
}
| MutVarClosure
{ info :: !StgInfoTable
, GenClosure b -> b
var :: !b
}
| BlockingQueueClosure
{ info :: !StgInfoTable
, GenClosure b -> b
link :: !b
, GenClosure b -> b
blackHole :: !b
, GenClosure b -> b
owner :: !b
, GenClosure b -> b
queue :: !b
}
| WeakClosure
{ info :: !StgInfoTable
, GenClosure b -> b
cfinalizers :: !b
, GenClosure b -> b
key :: !b
, value :: !b
, GenClosure b -> b
finalizer :: !b
, link :: !b
}
| IntClosure
{ GenClosure b -> PrimType
ptipe :: PrimType
, GenClosure b -> Int
intVal :: !Int }
| WordClosure
{ ptipe :: PrimType
, GenClosure b -> Word
wordVal :: !Word }
| Int64Closure
{ ptipe :: PrimType
, GenClosure b -> Int64
int64Val :: !Int64 }
| Word64Closure
{ ptipe :: PrimType
, GenClosure b -> Word64
word64Val :: !Word64 }
| AddrClosure
{ ptipe :: PrimType
, GenClosure b -> Int
addrVal :: !Int }
| FloatClosure
{ ptipe :: PrimType
, GenClosure b -> Float
floatVal :: !Float }
| DoubleClosure
{ ptipe :: PrimType
, GenClosure b -> Double
doubleVal :: !Double }
| OtherClosure
{ info :: !StgInfoTable
, GenClosure b -> [b]
hvalues :: ![b]
, GenClosure b -> [Word]
rawWords :: ![Word]
}
| UnsupportedClosure
{ info :: !StgInfoTable
}
deriving (Int -> GenClosure b -> ShowS
[GenClosure b] -> ShowS
GenClosure b -> String
(Int -> GenClosure b -> ShowS)
-> (GenClosure b -> String)
-> ([GenClosure b] -> ShowS)
-> Show (GenClosure b)
forall b. Show b => Int -> GenClosure b -> ShowS
forall b. Show b => [GenClosure b] -> ShowS
forall b. Show b => GenClosure b -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenClosure b] -> ShowS
$cshowList :: forall b. Show b => [GenClosure b] -> ShowS
show :: GenClosure b -> String
$cshow :: forall b. Show b => GenClosure b -> String
showsPrec :: Int -> GenClosure b -> ShowS
$cshowsPrec :: forall b. Show b => Int -> GenClosure b -> ShowS
Show, (forall x. GenClosure b -> Rep (GenClosure b) x)
-> (forall x. Rep (GenClosure b) x -> GenClosure b)
-> Generic (GenClosure b)
forall x. Rep (GenClosure b) x -> GenClosure b
forall x. GenClosure b -> Rep (GenClosure b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall b x. Rep (GenClosure b) x -> GenClosure b
forall b x. GenClosure b -> Rep (GenClosure b) x
$cto :: forall b x. Rep (GenClosure b) x -> GenClosure b
$cfrom :: forall b x. GenClosure b -> Rep (GenClosure b) x
Generic, a -> GenClosure b -> GenClosure a
(a -> b) -> GenClosure a -> GenClosure b
(forall a b. (a -> b) -> GenClosure a -> GenClosure b)
-> (forall a b. a -> GenClosure b -> GenClosure a)
-> Functor GenClosure
forall a b. a -> GenClosure b -> GenClosure a
forall a b. (a -> b) -> GenClosure a -> GenClosure b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> GenClosure b -> GenClosure a
$c<$ :: forall a b. a -> GenClosure b -> GenClosure a
fmap :: (a -> b) -> GenClosure a -> GenClosure b
$cfmap :: forall a b. (a -> b) -> GenClosure a -> GenClosure b
Functor, GenClosure a -> Bool
(a -> m) -> GenClosure a -> m
(a -> b -> b) -> b -> GenClosure a -> b
(forall m. Monoid m => GenClosure m -> m)
-> (forall m a. Monoid m => (a -> m) -> GenClosure a -> m)
-> (forall m a. Monoid m => (a -> m) -> GenClosure a -> m)
-> (forall a b. (a -> b -> b) -> b -> GenClosure a -> b)
-> (forall a b. (a -> b -> b) -> b -> GenClosure a -> b)
-> (forall b a. (b -> a -> b) -> b -> GenClosure a -> b)
-> (forall b a. (b -> a -> b) -> b -> GenClosure a -> b)
-> (forall a. (a -> a -> a) -> GenClosure a -> a)
-> (forall a. (a -> a -> a) -> GenClosure a -> a)
-> (forall a. GenClosure a -> [a])
-> (forall a. GenClosure a -> Bool)
-> (forall a. GenClosure a -> Int)
-> (forall a. Eq a => a -> GenClosure a -> Bool)
-> (forall a. Ord a => GenClosure a -> a)
-> (forall a. Ord a => GenClosure a -> a)
-> (forall a. Num a => GenClosure a -> a)
-> (forall a. Num a => GenClosure a -> a)
-> Foldable GenClosure
forall a. Eq a => a -> GenClosure a -> Bool
forall a. Num a => GenClosure a -> a
forall a. Ord a => GenClosure a -> a
forall m. Monoid m => GenClosure m -> m
forall a. GenClosure a -> Bool
forall a. GenClosure a -> Int
forall a. GenClosure a -> [a]
forall a. (a -> a -> a) -> GenClosure a -> a
forall m a. Monoid m => (a -> m) -> GenClosure a -> m
forall b a. (b -> a -> b) -> b -> GenClosure a -> b
forall a b. (a -> b -> b) -> b -> GenClosure a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
product :: GenClosure a -> a
$cproduct :: forall a. Num a => GenClosure a -> a
sum :: GenClosure a -> a
$csum :: forall a. Num a => GenClosure a -> a
minimum :: GenClosure a -> a
$cminimum :: forall a. Ord a => GenClosure a -> a
maximum :: GenClosure a -> a
$cmaximum :: forall a. Ord a => GenClosure a -> a
elem :: a -> GenClosure a -> Bool
$celem :: forall a. Eq a => a -> GenClosure a -> Bool
length :: GenClosure a -> Int
$clength :: forall a. GenClosure a -> Int
null :: GenClosure a -> Bool
$cnull :: forall a. GenClosure a -> Bool
toList :: GenClosure a -> [a]
$ctoList :: forall a. GenClosure a -> [a]
foldl1 :: (a -> a -> a) -> GenClosure a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> GenClosure a -> a
foldr1 :: (a -> a -> a) -> GenClosure a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> GenClosure a -> a
foldl' :: (b -> a -> b) -> b -> GenClosure a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> GenClosure a -> b
foldl :: (b -> a -> b) -> b -> GenClosure a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> GenClosure a -> b
foldr' :: (a -> b -> b) -> b -> GenClosure a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> GenClosure a -> b
foldr :: (a -> b -> b) -> b -> GenClosure a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> GenClosure a -> b
foldMap' :: (a -> m) -> GenClosure a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> GenClosure a -> m
foldMap :: (a -> m) -> GenClosure a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> GenClosure a -> m
fold :: GenClosure m -> m
$cfold :: forall m. Monoid m => GenClosure m -> m
Foldable, Functor GenClosure
Foldable GenClosure
Functor GenClosure
-> Foldable GenClosure
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GenClosure a -> f (GenClosure b))
-> (forall (f :: * -> *) a.
Applicative f =>
GenClosure (f a) -> f (GenClosure a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GenClosure a -> m (GenClosure b))
-> (forall (m :: * -> *) a.
Monad m =>
GenClosure (m a) -> m (GenClosure a))
-> Traversable GenClosure
(a -> f b) -> GenClosure a -> f (GenClosure b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
GenClosure (m a) -> m (GenClosure a)
forall (f :: * -> *) a.
Applicative f =>
GenClosure (f a) -> f (GenClosure a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GenClosure a -> m (GenClosure b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GenClosure a -> f (GenClosure b)
sequence :: GenClosure (m a) -> m (GenClosure a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
GenClosure (m a) -> m (GenClosure a)
mapM :: (a -> m b) -> GenClosure a -> m (GenClosure b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GenClosure a -> m (GenClosure b)
sequenceA :: GenClosure (f a) -> f (GenClosure a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
GenClosure (f a) -> f (GenClosure a)
traverse :: (a -> f b) -> GenClosure a -> f (GenClosure b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GenClosure a -> f (GenClosure b)
$cp2Traversable :: Foldable GenClosure
$cp1Traversable :: Functor GenClosure
Traversable)
data PrimType
= PInt
| PWord
| PInt64
| PWord64
| PAddr
| PFloat
| PDouble
deriving (PrimType -> PrimType -> Bool
(PrimType -> PrimType -> Bool)
-> (PrimType -> PrimType -> Bool) -> Eq PrimType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PrimType -> PrimType -> Bool
$c/= :: PrimType -> PrimType -> Bool
== :: PrimType -> PrimType -> Bool
$c== :: PrimType -> PrimType -> Bool
Eq, Int -> PrimType -> ShowS
[PrimType] -> ShowS
PrimType -> String
(Int -> PrimType -> ShowS)
-> (PrimType -> String) -> ([PrimType] -> ShowS) -> Show PrimType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrimType] -> ShowS
$cshowList :: [PrimType] -> ShowS
show :: PrimType -> String
$cshow :: PrimType -> String
showsPrec :: Int -> PrimType -> ShowS
$cshowsPrec :: Int -> PrimType -> ShowS
Show, (forall x. PrimType -> Rep PrimType x)
-> (forall x. Rep PrimType x -> PrimType) -> Generic PrimType
forall x. Rep PrimType x -> PrimType
forall x. PrimType -> Rep PrimType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrimType x -> PrimType
$cfrom :: forall x. PrimType -> Rep PrimType x
Generic)
allClosures :: GenClosure b -> [b]
allClosures :: GenClosure b -> [b]
allClosures (ConstrClosure {[b]
String
[Word]
StgInfoTable
name :: String
modl :: String
pkg :: String
dataArgs :: [Word]
ptrArgs :: [b]
info :: StgInfoTable
name :: forall b. GenClosure b -> String
modl :: forall b. GenClosure b -> String
pkg :: forall b. GenClosure b -> String
dataArgs :: forall b. GenClosure b -> [Word]
ptrArgs :: forall a. GenClosure a -> [a]
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b]
ptrArgs
allClosures (ThunkClosure {[b]
[Word]
StgInfoTable
dataArgs :: [Word]
ptrArgs :: [b]
info :: StgInfoTable
dataArgs :: forall b. GenClosure b -> [Word]
ptrArgs :: forall a. GenClosure a -> [a]
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b]
ptrArgs
allClosures (SelectorClosure {b
StgInfoTable
selectee :: b
info :: StgInfoTable
selectee :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
selectee]
allClosures (IndClosure {b
StgInfoTable
indirectee :: b
info :: StgInfoTable
indirectee :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
indirectee]
allClosures (BlackholeClosure {b
StgInfoTable
indirectee :: b
info :: StgInfoTable
indirectee :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
indirectee]
allClosures (APClosure {b
[b]
HalfWord
StgInfoTable
payload :: [b]
fun :: b
n_args :: HalfWord
arity :: HalfWord
info :: StgInfoTable
payload :: forall a. GenClosure a -> [a]
fun :: forall b. GenClosure b -> b
n_args :: forall b. GenClosure b -> HalfWord
arity :: forall b. GenClosure b -> HalfWord
info :: forall b. GenClosure b -> StgInfoTable
..}) = b
funb -> [b] -> [b]
forall a. a -> [a] -> [a]
:[b]
payload
allClosures (PAPClosure {b
[b]
HalfWord
StgInfoTable
payload :: [b]
fun :: b
n_args :: HalfWord
arity :: HalfWord
info :: StgInfoTable
payload :: forall a. GenClosure a -> [a]
fun :: forall b. GenClosure b -> b
n_args :: forall b. GenClosure b -> HalfWord
arity :: forall b. GenClosure b -> HalfWord
info :: forall b. GenClosure b -> StgInfoTable
..}) = b
funb -> [b] -> [b]
forall a. a -> [a] -> [a]
:[b]
payload
allClosures (APStackClosure {b
[b]
StgInfoTable
payload :: [b]
fun :: b
info :: StgInfoTable
payload :: forall a. GenClosure a -> [a]
fun :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = b
funb -> [b] -> [b]
forall a. a -> [a] -> [a]
:[b]
payload
allClosures (BCOClosure {b
[Word]
HalfWord
StgInfoTable
bitmap :: [Word]
size :: HalfWord
arity :: HalfWord
bcoptrs :: b
literals :: b
instrs :: b
info :: StgInfoTable
bitmap :: forall b. GenClosure b -> [Word]
size :: forall b. GenClosure b -> HalfWord
bcoptrs :: forall b. GenClosure b -> b
literals :: forall b. GenClosure b -> b
instrs :: forall b. GenClosure b -> b
arity :: forall b. GenClosure b -> HalfWord
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
instrs,b
literals,b
bcoptrs]
allClosures (ArrWordsClosure {}) = []
allClosures (MutArrClosure {[b]
Word
StgInfoTable
mccPayload :: [b]
mccSize :: Word
mccPtrs :: Word
info :: StgInfoTable
mccPayload :: forall a. GenClosure a -> [a]
mccSize :: forall b. GenClosure b -> Word
mccPtrs :: forall b. GenClosure b -> Word
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b]
mccPayload
allClosures (SmallMutArrClosure {[b]
Word
StgInfoTable
mccPayload :: [b]
mccPtrs :: Word
info :: StgInfoTable
mccPayload :: forall a. GenClosure a -> [a]
mccPtrs :: forall b. GenClosure b -> Word
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b]
mccPayload
allClosures (MutVarClosure {b
StgInfoTable
var :: b
info :: StgInfoTable
var :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
var]
allClosures (MVarClosure {b
StgInfoTable
value :: b
queueTail :: b
queueHead :: b
info :: StgInfoTable
value :: forall b. GenClosure b -> b
queueTail :: forall b. GenClosure b -> b
queueHead :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
queueHead,b
queueTail,b
value]
allClosures (FunClosure {[b]
[Word]
StgInfoTable
dataArgs :: [Word]
ptrArgs :: [b]
info :: StgInfoTable
dataArgs :: forall b. GenClosure b -> [Word]
ptrArgs :: forall a. GenClosure a -> [a]
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b]
ptrArgs
allClosures (BlockingQueueClosure {b
StgInfoTable
queue :: b
owner :: b
blackHole :: b
link :: b
info :: StgInfoTable
queue :: forall b. GenClosure b -> b
owner :: forall b. GenClosure b -> b
blackHole :: forall b. GenClosure b -> b
link :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
link, b
blackHole, b
owner, b
queue]
allClosures (WeakClosure {b
StgInfoTable
link :: b
finalizer :: b
value :: b
key :: b
cfinalizers :: b
info :: StgInfoTable
finalizer :: forall b. GenClosure b -> b
key :: forall b. GenClosure b -> b
cfinalizers :: forall b. GenClosure b -> b
link :: forall b. GenClosure b -> b
value :: forall b. GenClosure b -> b
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b
cfinalizers, b
key, b
value, b
finalizer, b
link]
allClosures (OtherClosure {[b]
[Word]
StgInfoTable
rawWords :: [Word]
hvalues :: [b]
info :: StgInfoTable
rawWords :: forall b. GenClosure b -> [Word]
hvalues :: forall a. GenClosure a -> [a]
info :: forall b. GenClosure b -> StgInfoTable
..}) = [b]
hvalues
allClosures GenClosure b
_ = []
#if __GLASGOW_HASKELL__ >= 809
closureSize :: Box -> Int
closureSize :: Box -> Int
closureSize (Box Any
x) = Int# -> Int
I# (Any -> Int#
forall a. a -> Int#
closureSize# Any
x)
#endif