| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
GHC.ByteCode.Serialize
Contents
Description
This module implements the serialization of bytecode objects to and from disk.
Synopsis
- writeBinByteCode :: FilePath -> ModuleByteCode -> IO ()
- readBinByteCode :: HscEnv -> FilePath -> IO ModuleByteCode
- data ModuleByteCode = ModuleByteCode {}
- data BytecodeLibX a = BytecodeLib {}
- type BytecodeLib = BytecodeLibX (Maybe InterpreterLibrary)
- type OnDiskBytecodeLib = BytecodeLibX (Maybe InterpreterLibraryContents)
- data InterpreterLibrary
- data InterpreterLibraryContents
- writeBytecodeLib :: BytecodeLib -> FilePath -> IO ()
- readBytecodeLib :: HscEnv -> FilePath -> IO OnDiskBytecodeLib
- decodeOnDiskModuleByteCode :: HscEnv -> OnDiskModuleByteCode -> IO ModuleByteCode
- decodeOnDiskBytecodeLib :: HscEnv -> OnDiskBytecodeLib -> IO BytecodeLib
Documentation
writeBinByteCode :: FilePath -> ModuleByteCode -> IO () Source #
Write a ModuleByteCode to a file.
readBinByteCode :: HscEnv -> FilePath -> IO ModuleByteCode Source #
Read a ModuleByteCode from a file.
data ModuleByteCode Source #
The in-memory representation of a bytecode object These are stored on-disk as .gbc files.
Constructors
| ModuleByteCode | |
Fields
| |
Instances
| Outputable ModuleByteCode Source # | |
Defined in GHC.Linker.Types Methods ppr :: ModuleByteCode -> SDoc Source # | |
data BytecodeLibX a Source #
A bytecode library is a collection of CompiledByteCode objects and a .so file containing the combination of foreign stubs
Constructors
| BytecodeLib | |
Fields | |
Instances
| Binary OnDiskBytecodeLib Source # | |
Defined in GHC.ByteCode.Serialize Methods put_ :: WriteBinHandle -> OnDiskBytecodeLib -> IO () Source # put :: WriteBinHandle -> OnDiskBytecodeLib -> IO (Bin OnDiskBytecodeLib) Source # get :: ReadBinHandle -> IO OnDiskBytecodeLib Source # | |
| Outputable a => Outputable (BytecodeLibX a) Source # | |
Defined in GHC.ByteCode.Serialize Methods ppr :: BytecodeLibX a -> SDoc Source # | |
type BytecodeLib = BytecodeLibX (Maybe InterpreterLibrary) Source #
data InterpreterLibrary Source #
Constructors
| InterpreterSharedObject | |
| InterpreterStaticObjects | |
Fields
| |
Instances
| Outputable InterpreterLibrary Source # | |
Defined in GHC.ByteCode.Serialize Methods ppr :: InterpreterLibrary -> SDoc Source # | |
data InterpreterLibraryContents Source #
Constructors
| InterpreterLibrarySharedContents | |
Fields | |
| InterpreterLibraryStaticContents | |
Fields | |
Instances
| Binary InterpreterLibraryContents Source # | |
Defined in GHC.ByteCode.Serialize Methods put_ :: WriteBinHandle -> InterpreterLibraryContents -> IO () Source # put :: WriteBinHandle -> InterpreterLibraryContents -> IO (Bin InterpreterLibraryContents) Source # get :: ReadBinHandle -> IO InterpreterLibraryContents Source # | |
| Binary OnDiskBytecodeLib Source # | |
Defined in GHC.ByteCode.Serialize Methods put_ :: WriteBinHandle -> OnDiskBytecodeLib -> IO () Source # put :: WriteBinHandle -> OnDiskBytecodeLib -> IO (Bin OnDiskBytecodeLib) Source # get :: ReadBinHandle -> IO OnDiskBytecodeLib Source # | |
writeBytecodeLib :: BytecodeLib -> FilePath -> IO () Source #
readBytecodeLib :: HscEnv -> FilePath -> IO OnDiskBytecodeLib Source #
decodeOnDiskModuleByteCode :: HscEnv -> OnDiskModuleByteCode -> IO ModuleByteCode Source #
Convert an OnDiskModuleByteCode to an ModuleByteCode.
OnDiskModuleByteCode is the representation which we read from a file,
the ModuleByteCode is the representation which is manipulated by program logic.
This notably writes the object files to temporary files. They are written to temporary files so that the normal object file loading code paths (which expect object files to exist as on-disk files) can be used in the loader.
Orphan instances
| Binary BCONPtr Source # | |
| Binary BCOPtr Source # | |
| Binary CompiledByteCode Source # | |
Methods put_ :: WriteBinHandle -> CompiledByteCode -> IO () Source # put :: WriteBinHandle -> CompiledByteCode -> IO (Bin CompiledByteCode) Source # get :: ReadBinHandle -> IO CompiledByteCode Source # | |
| Binary UnlinkedBCO Source # | |
Methods put_ :: WriteBinHandle -> UnlinkedBCO -> IO () Source # put :: WriteBinHandle -> UnlinkedBCO -> IO (Bin UnlinkedBCO) Source # get :: ReadBinHandle -> IO UnlinkedBCO Source # | |