X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmExpr.hs;h=a4d07c2c60316f6956af3e51d0241fa7219800ba;hb=836b1e90821aacc9d1e09fe78085f911597274c8;hp=7ea1c4760ac6c8d6b463ce867ff5c74f6f748871;hpb=31a9d04804d9cacda35695c5397590516b964964;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmExpr.hs b/compiler/cmm/CmmExpr.hs index 7ea1c47..a4d07c2 100644 --- a/compiler/cmm/CmmExpr.hs +++ b/compiler/cmm/CmmExpr.hs @@ -49,10 +49,7 @@ import CLabel import Constants import FastString import FiniteMap -import Maybes -import Monad import Outputable -import Panic import Unique import UniqSet @@ -98,13 +95,32 @@ data Area deriving (Eq, Ord) data AreaId - = Old -- entry parameters, jumps, and returns share one call area at old end of stack + = Old -- See Note [Old Area] | Young BlockId deriving (Eq, Ord) +{- Note [Old Area] +~~~~~~~~~~~~~~~~~~ +There is a single call area 'Old', allocated at the extreme old +end of the stack frame (ie just younger than the return address) +which holds: + * incoming (overflow) parameters, + * outgoing (overflow) parameter to tail calls, + * outgoing (overflow) result values + * the update frame (if any) + +Its size is the max of all these requirements. On entry, the stack +pointer will point to the youngest incoming parameter, which is not +necessarily at the young end of the Old area. + +End of note -} + type SubArea = (Area, Int, Int) -- area, offset, width type SubAreaSet = FiniteMap Area [SubArea] + type AreaMap = FiniteMap Area Int + -- Byte offset of the oldest byte of the Area, + -- relative to the oldest byte of the Old Area data CmmLit = CmmInt Integer Width