ghc-10.0.0.20260917: The GHC API
Safe HaskellNone
LanguageGHC2024

GHC.ByteCode.Instr

Description

Bytecode instruction definitions

Synopsis

Documentation

data BCInstr Source #

Constructors

STKCHECK !Word 
PUSH_L !WordOff 
PUSH_LL !WordOff !WordOff 
PUSH_LLL !WordOff !WordOff !WordOff 
PUSH8 !ByteOff 
PUSH16 !ByteOff 
PUSH32 !ByteOff 
PUSH8_W !ByteOff 
PUSH16_W !ByteOff 
PUSH32_W !ByteOff 
PUSH_G Name 
PUSH_PRIMOP PrimOp 
PUSH_BCO ProtoBCO 
PUSH_ALTS ProtoBCO ArgRep 
PUSH_ALTS_TUPLE ProtoBCO !NativeCallInfo ProtoBCO 
PUSH_PAD8 
PUSH_PAD16 
PUSH_PAD32 
PUSH_UBX8 Literal 
PUSH_UBX16 Literal 
PUSH_UBX32 Literal 
PUSH_UBX Literal !WordOff 
PUSH_ADDR Name 
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

Drop entries (n, n+by] entries from the stack. Graphically: a_1 ← top ... a_n b_1 => a_1 ← top ... ... b_by a_n k k

Fields

ALLOC_AP !HalfWord 
ALLOC_AP_NOUPD !HalfWord 
ALLOC_PAP !HalfWord !HalfWord 
MKAP !WordOff !HalfWord 
MKPAP !WordOff !HalfWord 
UNPACK !WordOff 
PACK DataCon !WordOff 
LABEL LocalLabel 
TESTLT_I !Int LocalLabel 
TESTEQ_I !Int LocalLabel 
TESTLT_W !Word LocalLabel 
TESTEQ_W !Word LocalLabel 
TESTLT_I64 !Int64 LocalLabel 
TESTEQ_I64 !Int64 LocalLabel 
TESTLT_I32 !Int32 LocalLabel 
TESTEQ_I32 !Int32 LocalLabel 
TESTLT_I16 !Int16 LocalLabel 
TESTEQ_I16 !Int16 LocalLabel 
TESTLT_I8 !Int8 LocalLabel 
TESTEQ_I8 !Int16 LocalLabel 
TESTLT_W64 !Word64 LocalLabel 
TESTEQ_W64 !Word64 LocalLabel 
TESTLT_W32 !Word32 LocalLabel 
TESTEQ_W32 !Word32 LocalLabel 
TESTLT_W16 !Word16 LocalLabel 
TESTEQ_W16 !Word16 LocalLabel 
TESTLT_W8 !Word8 LocalLabel 
TESTEQ_W8 !Word8 LocalLabel 
TESTLT_F !Float LocalLabel 
TESTEQ_F !Float LocalLabel 
TESTLT_D !Double LocalLabel 
TESTEQ_D !Double LocalLabel 
TESTLT_P !Word16 LocalLabel

Test whether the tag of a closure pointer is less than the given value. If not, jump to the given label.

TESTEQ_P !Word16 LocalLabel

Test whether the tag of a closure pointer is equal to the given value. If not, jump to the given label.

CASEFAIL 
JMP LocalLabel 
CCALL !WordOff !FFIInfo !Word16 
PRIMCALL 
OP_ADD !Width 
OP_SUB !Width 
OP_AND !Width 
OP_XOR !Width 
OP_MUL !Width 
OP_SHL !Width 
OP_ASR !Width 
OP_LSR !Width 
OP_OR !Width 
OP_NOT !Width 
OP_NEG !Width 
OP_NEQ !Width 
OP_EQ !Width 
OP_U_LT !Width 
OP_U_GE !Width 
OP_U_GT !Width 
OP_U_LE !Width 
OP_S_LT !Width 
OP_S_GE !Width 
OP_S_GT !Width 
OP_S_LE !Width 
OP_INDEX_ADDR !Width 
SWIZZLE !WordOff !Int 
ENTER 
RETURN ArgRep 
RETURN_TUPLE 
BRK_FUN !InternalBreakpointId 
BCO_NAME !ByteString

A "meta"-instruction for recording the name of a BCO for debugging purposes. These are ignored by the interpreter but helpfully printed by the disassmbler.

Instances

Instances details
Outputable BCInstr Source # 
Instance details

Defined in GHC.ByteCode.Instr

Methods

ppr :: BCInstr -> SDoc Source #

data ProtoBCO Source #

Constructors

ProtoBCO 

Fields

ProtoStaticCon

A top-level static constructor application object See Note [Static constructors in Bytecode]

Fields

  • protoStaticConName :: Name

    The name to which this static constructor is bound, not to be confused with the DataCon itself.

  • protoStaticCon :: DataCon

    The DataCon being constructed. We use this to construct the right info table.

  • protoStaticConData :: [Either Literal Id]

    The static constructor pointer and non-pointer arguments, sorted in the order they should appear at runtime (see mkVirtHeapOffsetsWithPadding in schemeTopBind).

    The non-pointer arguments are meant to be laid contiguously in memory using the width of each literal individually. The padding is given as Literals of value 0 with the appropriate width.

  • protoStaticConNonPtrsSize :: Int

    How many words needed to store the non-pointer arguments. Note that this may be smaller than the number of non-pointer arguments, since subword arguments need to be packed.

  • protoStaticConExpr :: CgStgRhs

    What the static con came from, for debugging only

Instances

Instances details
Outputable ProtoBCO Source # 
Instance details

Defined in GHC.ByteCode.Instr

Methods

ppr :: ProtoBCO -> SDoc Source #

newtype LocalLabel Source #

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

Constructors

LocalLabel