@@ -37,9 +37,7 @@ import GHCi.ResolvedBCO
3737
3838import GHC.LanguageExtensions
3939import GHC.InfoProv
40- #if MIN_VERSION_ghc_internal(9,1500,0)
41- import qualified GHC.Exts.Heap as Heap
42- #else
40+ #ifndef BOOTSTRAPPING
4341import qualified GHC.Exts.Heap as Heap
4442#endif
4543import GHC.ForeignSrcLang
@@ -122,9 +120,15 @@ data Message a where
122120 FreeFFI :: RemotePtr C_ffi_cif -> Message ()
123121
124122 -- | Create an info table for a constructor
123+ #ifndef BOOTSTRAPPING
125124 MkConInfoTable
126125 :: ! ConInfoTable
127126 -> Message (RemotePtr Heap. StgInfoTable )
127+ #else
128+ MkConInfoTable
129+ :: ! ConInfoTable
130+ -> Message (RemotePtr () )
131+ #endif
128132
129133 -- | Evaluate a statement
130134 EvalStmt
@@ -225,9 +229,11 @@ data Message a where
225229 -- | Remote interface to GHC.Internal.Heap.getClosureData. This is used by
226230 -- the GHCi debugger to inspect values in the heap for :print and
227231 -- type reconstruction.
232+ #ifndef BOOTSTRAPPING
228233 GetClosure
229234 :: HValueRef
230235 -> Message (Heap. GenClosure HValueRef )
236+ #endif
231237
232238 -- | Remote interface to GHC.InfoProv.whereFrom. This is used by
233239 -- the GHCi debugger to inspect the provenance of thunks for :print.
@@ -522,11 +528,14 @@ instance Binary (FunPtr a) where
522528 put = put . castFunPtrToPtr
523529 get = castPtrToFunPtr <$> get
524530
531+ #ifndef BOOTSTRAPPING
532+ #if defined(MIN_VERSION_ghc_internal)
525533#if MIN_VERSION_ghc_internal(9,1400,0)
526534instance Binary Heap. HalfWord where
527535 put x = put (fromIntegral x :: Word32 )
528536 get = fromIntegral <$> (get :: Get Word32 )
529537#endif
538+ #endif
530539
531540-- Binary instances to support the GetClosure message
532541instance Binary Heap. StgTSOProfInfo
@@ -541,6 +550,7 @@ instance Binary Heap.StgInfoTable
541550instance Binary Heap. ClosureType
542551instance Binary Heap. PrimType
543552instance Binary a => Binary (Heap. GenClosure a )
553+ #endif
544554instance Binary InfoProv where
545555#if MIN_VERSION_base(4,20,0)
546556 get = InfoProv <$> get <*> get <*> get <*> get <*> get <*> get <*> get <*> get
@@ -593,7 +603,9 @@ getMessage = do
593603 32 -> Msg <$> (RunModFinalizers <$> get <*> get)
594604 33 -> Msg <$> (AddSptEntry <$> get <*> get)
595605 34 -> Msg <$> (RunTH <$> get <*> get <*> get <*> get)
606+ #ifndef BOOTSTRAPPING
596607 35 -> Msg <$> (GetClosure <$> get)
608+ #endif
597609 36 -> Msg <$> (Seq <$> get)
598610 37 -> Msg <$> return RtsRevertCAFs
599611 38 -> Msg <$> (ResumeSeq <$> get)
@@ -639,7 +651,9 @@ putMessage m = case m of
639651 RunModFinalizers a b -> putWord8 32 >> put a >> put b
640652 AddSptEntry a b -> putWord8 33 >> put a >> put b
641653 RunTH st q loc ty -> putWord8 34 >> put st >> put q >> put loc >> put ty
654+ #ifndef BOOTSTRAPPING
642655 GetClosure a -> putWord8 35 >> put a
656+ #endif
643657 Seq a -> putWord8 36 >> put a
644658 RtsRevertCAFs -> putWord8 37
645659 ResumeSeq a -> putWord8 38 >> put a
0 commit comments