module GHCi.ResolvedBCO
( ResolvedBCO(..)
, ResolvedBCOPtr(..)
, isLittleEndian
) where
import Prelude
import SizedSeq
import GHCi.RemoteTypes
import GHCi.BreakArray
import Data.Array.Unboxed
import Data.Binary
import GHC.Generics
import GHCi.BinaryArray
#include "MachDeps.h"
isLittleEndian :: Bool
#if defined(WORDS_BIGENDIAN)
isLittleEndian = True
#else
isLittleEndian = False
#endif
data ResolvedBCO
= ResolvedBCO {
resolvedBCOIsLE :: Bool,
resolvedBCOArity :: !Int,
resolvedBCOInstrs :: UArray Int Word16,
resolvedBCOBitmap :: UArray Int Word64,
resolvedBCOLits :: UArray Int Word64,
resolvedBCOPtrs :: (SizedSeq ResolvedBCOPtr)
}
deriving (Generic, Show)
instance Binary ResolvedBCO where
put ResolvedBCO{..} = do
put resolvedBCOIsLE
put resolvedBCOArity
putArray resolvedBCOInstrs
putArray resolvedBCOBitmap
putArray resolvedBCOLits
put resolvedBCOPtrs
get = ResolvedBCO
<$> get <*> get <*> getArray <*> getArray <*> getArray <*> get
data ResolvedBCOPtr
= ResolvedBCORef !Int
| ResolvedBCOPtr !(RemoteRef HValue)
| ResolvedBCOStaticPtr !(RemotePtr ())
| ResolvedBCOPtrBCO ResolvedBCO
| ResolvedBCOPtrBreakArray !(RemoteRef BreakArray)
deriving (Generic, Show)
instance Binary ResolvedBCOPtr