{-# LINE 1 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
module GHC.Exts.Heap.InfoTable
( module GHC.Exts.Heap.InfoTable.Types
, itblSize
, peekItbl
, pokeItbl
) where
import Prelude
import GHC.Exts.Heap.InfoTable.Types
{-# LINE 13 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
import GHC.Exts.Heap.Constants
import Data.Maybe
{-# LINE 16 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
import Foreign
peekItbl :: Ptr StgInfoTable -> IO StgInfoTable
peekItbl :: Ptr StgInfoTable -> IO StgInfoTable
peekItbl Ptr StgInfoTable
a0 = do
{-# LINE 32 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
let ptr = a0 `plusPtr` (negate wORD_SIZE)
entry' <- Just <$> ((\hsc_ptr -> peekByteOff hsc_ptr 0)) ptr
{-# LINE 34 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
{-# LINE 38 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
ptrs' <- ((\hsc_ptr -> peekByteOff hsc_ptr 4)) ptr
{-# LINE 39 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
nptrs' <- ((\hsc_ptr -> peekByteOff hsc_ptr 6)) ptr
{-# LINE 40 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
tipe' <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 41 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
srtlen' <- ((\hsc_ptr -> peekByteOff hsc_ptr 10)) a0
{-# LINE 42 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
return StgInfoTable
{ entry = entry'
, ptrs = ptrs'
, nptrs = nptrs'
, tipe = toEnum (fromIntegral (tipe' :: HalfWord))
, srtlen = srtlen'
, code = Nothing
}
pokeItbl :: Ptr StgInfoTable -> StgInfoTable -> IO ()
pokeItbl :: Ptr StgInfoTable -> StgInfoTable -> IO ()
pokeItbl Ptr StgInfoTable
a0 StgInfoTable
itbl = do
{-# LINE 54 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) a0 (fromJust (entry itbl))
{-# LINE 55 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
{-# LINE 56 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 4)) a0 (ptrs itbl)
{-# LINE 57 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 6)) a0 (nptrs itbl)
{-# LINE 58 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) a0 (toHalfWord (fromEnum (tipe itbl)))
{-# LINE 59 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 10)) a0 (srtlen itbl)
{-# LINE 60 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
{-# LINE 67 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}
where
toHalfWord :: Int -> HalfWord
toHalfWord :: Int -> HalfWord
toHalfWord Int
i = Int -> HalfWord
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
itblSize :: Int
itblSize :: Int
itblSize = ((Int
12))
{-# LINE 74 "libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc" #-}