GHC.ByteCode.Instr

ghc-9.2.5: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.ByteCode.Instr

Description

Bytecode instruction definitions

Synopsis

- data BCInstr
  - = STKCHECK Word
  - | PUSH_L !Word16
  - | PUSH_LL !Word16 !Word16
  - | PUSH_LLL !Word16 !Word16 !Word16
  - | PUSH8 !Word16
  - | PUSH16 !Word16
  - | PUSH32 !Word16
  - | PUSH8_W !Word16
  - | PUSH16_W !Word16
  - | PUSH32_W !Word16
  - | PUSH_G Name
  - | PUSH_PRIMOP PrimOp
  - | PUSH_BCO (ProtoBCO Name)
  - | PUSH_ALTS (ProtoBCO Name)
  - | PUSH_ALTS_UNLIFTED (ProtoBCO Name) ArgRep
  - | PUSH_ALTS_TUPLE (ProtoBCO Name) !TupleInfo (ProtoBCO Name)
  - | PUSH_PAD8
  - | PUSH_PAD16
  - | PUSH_PAD32
  - | PUSH_UBX8 Literal
  - | PUSH_UBX16 Literal
  - | PUSH_UBX32 Literal
  - | PUSH_UBX Literal Word16
  - | PUSH_APPLY_N
  - | PUSH_APPLY_V
  - | PUSH_APPLY_F
  - | PUSH_APPLY_D
  - | PUSH_APPLY_L
  - | PUSH_APPLY_P
  - | PUSH_APPLY_PP
  - | PUSH_APPLY_PPP
  - | PUSH_APPLY_PPPP
  - | PUSH_APPLY_PPPPP
  - | PUSH_APPLY_PPPPPP
  - | SLIDE Word16 Word16
  - | ALLOC_AP !Word16
  - | ALLOC_AP_NOUPD !Word16
  - | ALLOC_PAP !Word16 !Word16
  - | MKAP !Word16 !Word16
  - | MKPAP !Word16 !Word16
  - | UNPACK !Word16
  - | PACK DataCon !Word16
  - | LABEL LocalLabel
  - | TESTLT_I Int LocalLabel
  - | TESTEQ_I Int LocalLabel
  - | TESTLT_W Word LocalLabel
  - | TESTEQ_W Word LocalLabel
  - | TESTLT_F Float LocalLabel
  - | TESTEQ_F Float LocalLabel
  - | TESTLT_D Double LocalLabel
  - | TESTEQ_D Double LocalLabel
  - | TESTLT_P Word16 LocalLabel
  - | TESTEQ_P Word16 LocalLabel
  - | CASEFAIL
  - | JMP LocalLabel
  - | CCALL Word16 (RemotePtr C_ffi_cif) Word16
  - | SWIZZLE Word16 Word16
  - | ENTER
  - | RETURN
  - | RETURN_UNLIFTED ArgRep
  - | RETURN_TUPLE
  - | BRK_FUN Word16 Unique (RemotePtr CostCentre)
- data ProtoBCO a = ProtoBCO {
  - protoBCOName :: a
  - protoBCOInstrs :: [BCInstr]
  - protoBCOBitmap :: [StgWord]
  - protoBCOBitmapSize :: Word16
  - protoBCOArity :: Int
  - protoBCOExpr :: Either [CgStgAlt] CgStgRhs
  - protoBCOFFIs :: [FFIInfo]
  }
- bciStackUse :: BCInstr -> Word
- newtype LocalLabel = LocalLabel {
  - getLocalLabel :: Word32
  }

# Documentation

data BCInstr Source #

Constructors

STKCHECK Word |
PUSH_L !Word16 |
PUSH_LL !Word16 !Word16 |
PUSH_LLL !Word16 !Word16 !Word16 |
PUSH8 !Word16 |
PUSH16 !Word16 |
PUSH32 !Word16 |
PUSH8_W !Word16 |
PUSH16_W !Word16 |
PUSH32_W !Word16 |
PUSH_G Name |
PUSH_PRIMOP PrimOp |
PUSH_BCO (ProtoBCO Name) |
PUSH_ALTS (ProtoBCO Name) |
PUSH_ALTS_UNLIFTED (ProtoBCO Name) ArgRep |
PUSH_ALTS_TUPLE (ProtoBCO Name) !TupleInfo (ProtoBCO Name) |
PUSH_PAD8 |
PUSH_PAD16 |
PUSH_PAD32 |
PUSH_UBX8 Literal |
PUSH_UBX16 Literal |
PUSH_UBX32 Literal |
PUSH_UBX Literal Word16 |
PUSH_APPLY_N |
PUSH_APPLY_V |
PUSH_APPLY_F |
PUSH_APPLY_D |
PUSH_APPLY_L |
PUSH_APPLY_P |
PUSH_APPLY_PP |
PUSH_APPLY_PPP |
PUSH_APPLY_PPPP |
PUSH_APPLY_PPPPP |
PUSH_APPLY_PPPPPP |
SLIDE Word16 Word16 |
ALLOC_AP !Word16 |
ALLOC_AP_NOUPD !Word16 |
ALLOC_PAP !Word16 !Word16 |
MKAP !Word16 !Word16 |
MKPAP !Word16 !Word16 |
UNPACK !Word16 |
PACK DataCon !Word16 |
LABEL LocalLabel |
TESTLT_I Int LocalLabel |
TESTEQ_I Int LocalLabel |
TESTLT_W Word LocalLabel |
TESTEQ_W Word LocalLabel |
TESTLT_F Float LocalLabel |
TESTEQ_F Float LocalLabel |
TESTLT_D Double LocalLabel |
TESTEQ_D Double LocalLabel |
TESTLT_P Word16 LocalLabel |
TESTEQ_P Word16 LocalLabel |
CASEFAIL |
JMP LocalLabel |
CCALL Word16 (RemotePtr C_ffi_cif) Word16 |
SWIZZLE Word16 Word16 |
ENTER |
RETURN |
RETURN_UNLIFTED ArgRep |
RETURN_TUPLE |
BRK_FUN Word16 Unique (RemotePtr CostCentre) |

#### Instances

Instances details

Outputable BCInstr Source # |
Instance details Defined in GHC.ByteCode.Instr Methods ppr :: BCInstr -> SDoc Source #

data ProtoBCO a Source #

Constructors

ProtoBCO |
Fields protoBCOName :: a protoBCOInstrs :: [BCInstr] protoBCOBitmap :: [StgWord] protoBCOBitmapSize :: Word16 protoBCOArity :: Int protoBCOExpr :: Either [CgStgAlt] CgStgRhs protoBCOFFIs :: [FFIInfo]

#### Instances

Instances details

Outputable a => Outputable (ProtoBCO a) Source # |
Instance details Defined in GHC.ByteCode.Instr Methods ppr :: ProtoBCO a -> SDoc Source #

bciStackUse :: BCInstr -> Word Source #

newtype LocalLabel Source #

A local block label (e.g. identifying a case alternative).

Constructors

LocalLabel |
Fields getLocalLabel :: Word32

#### Instances

Instances details

Outputable LocalLabel Source # |
Instance details Defined in GHC.ByteCode.Instr Methods ppr :: LocalLabel -> SDoc Source #
Eq LocalLabel Source # |
Instance details Defined in GHC.ByteCode.Instr Methods (==) :: LocalLabel -> LocalLabel -> Bool # (/=) :: LocalLabel -> LocalLabel -> Bool #
Ord LocalLabel Source # |
Instance details Defined in GHC.ByteCode.Instr Methods compare :: LocalLabel -> LocalLabel -> Ordering # (<) :: LocalLabel -> LocalLabel -> Bool # (<=) :: LocalLabel -> LocalLabel -> Bool # (>) :: LocalLabel -> LocalLabel -> Bool # (>=) :: LocalLabel -> LocalLabel -> Bool # max :: LocalLabel -> LocalLabel -> LocalLabel # min :: LocalLabel -> LocalLabel -> LocalLabel #