Commit daa2d5e3 authored by Simon Marlow's avatar Simon Marlow

a bit more UNPACKing

parent bb7d711c
......@@ -43,10 +43,11 @@ import qualified Data.Set as Set
data CmmExpr
= CmmLit CmmLit -- Literal
| CmmLoad !CmmExpr !CmmType -- Read memory location
| CmmLoad !CmmExpr !CmmType -- Read memory location
| CmmReg !CmmReg -- Contents of register
| CmmMachOp MachOp [CmmExpr] -- Machine operation (+, -, *, etc.)
| CmmStackSlot Area Int -- addressing expression of a stack slot
| CmmStackSlot Area {-# UNPACK #-} !Int
-- addressing expression of a stack slot
| CmmRegOff !CmmReg Int
-- CmmRegOff reg i
-- ** is shorthand only, meaning **
......@@ -71,7 +72,7 @@ data CmmReg
-- or the stack space where function arguments and results are passed.
data Area
= Old -- See Note [Old Area]
| Young BlockId -- Invariant: must be a continuation BlockId
| Young {-# UNPACK #-} !BlockId -- Invariant: must be a continuation BlockId
-- See Note [Continuation BlockId] in CmmNode.
deriving (Eq, Ord)
......@@ -111,7 +112,7 @@ data CmmLit
-- position-independent code.
| CmmLabelDiffOff CLabel CLabel Int -- label1 - label2 + offset
| CmmBlock BlockId -- Code label
| CmmBlock {-# UNPACK #-} !BlockId -- Code label
-- Invariant: must be a continuation BlockId
-- See Note [Continuation BlockId] in CmmNode.
......
......@@ -35,8 +35,10 @@ import Prelude hiding (succ)
------------------------
-- CmmNode
#define ULabel {-# UNPACK #-} !Label
data CmmNode e x where
CmmEntry :: {-# UNPACK #-} !Label -> CmmNode C O
CmmEntry :: ULabel -> CmmNode C O
CmmComment :: FastString -> CmmNode O O
......@@ -60,11 +62,12 @@ data CmmNode e x where
-- bug for what can be put in arguments, see
-- Note [Register Parameter Passing]
CmmBranch :: Label -> CmmNode O C -- Goto another block in the same procedure
CmmBranch :: ULabel -> CmmNode O C
-- Goto another block in the same procedure
CmmCondBranch :: { -- conditional branch
cml_pred :: CmmExpr,
cml_true, cml_false :: Label
cml_true, cml_false :: ULabel
} -> CmmNode O C
CmmSwitch :: CmmExpr -> [Maybe Label] -> CmmNode O C -- Table branch
......@@ -122,7 +125,7 @@ data CmmNode e x where
tgt :: ForeignTarget, -- call target and convention
res :: [CmmFormal], -- zero or more results
args :: [CmmActual], -- zero or more arguments; see Note [Register parameter passing]
succ :: Label, -- Label of continuation
succ :: ULabel, -- Label of continuation
updfr :: UpdFrameOffset, -- where the update frame is (for building infotable)
intrbl:: Bool -- whether or not the call is interruptible
} -> CmmNode O C
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment