| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
GHC.ByteCode.Serialize
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
- mkModuleByteCode :: Module -> CompiledByteCode -> [FilePath] -> IO ModuleByteCode
- fingerprintModuleByteCodeContents :: Module -> CompiledByteCode -> [FilePath] -> IO Fingerprint
- 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.Binary 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.Binary 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.Binary Methods ppr :: InterpreterLibrary -> SDoc Source # | |
data InterpreterLibraryContents Source #
Constructors
| InterpreterLibrarySharedContents | |
Fields | |
| InterpreterLibraryStaticContents | |
Fields | |
Instances
| Binary InterpreterLibraryContents Source # | |
Defined in GHC.ByteCode.Binary 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.Binary 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 #
mkModuleByteCode :: Module -> CompiledByteCode -> [FilePath] -> IO ModuleByteCode Source #
fingerprintModuleByteCodeContents :: Module -> CompiledByteCode -> [FilePath] -> IO Fingerprint Source #
Generate a Fingerprint for the ModuleByteCode contents.
Note, this will serialise the contents of the ModuleByteCode separately
to writeBytecodeLib.
This means, if the ModuleByteCode is written to disk, it will be
serialised twice.
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.