X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmm.hs;h=530fab570dc3e41dfcfcbd27c1691d273ad4ca28;hb=f96fcdc91b424aafca4d06572864fd20c475eaa0;hp=f5525a794e19f62d0f13a49ab7ced80364bbbe25;hpb=f96e9aa0444de0e673b3c4055c6e43299639bc5b;p=ghc-hetmet.git diff --git a/compiler/cmm/Cmm.hs b/compiler/cmm/Cmm.hs index f5525a7..530fab5 100644 --- a/compiler/cmm/Cmm.hs +++ b/compiler/cmm/Cmm.hs @@ -9,9 +9,10 @@ module Cmm ( GenCmm(..), Cmm, RawCmm, GenCmmTop(..), CmmTop, RawCmmTop, - CmmInfo(..), ClosureTypeInfo(..), ProfilingInfo(..), + CmmInfo(..), ClosureTypeInfo(..), ProfilingInfo(..), ClosureTypeTag, GenBasicBlock(..), CmmBasicBlock, blockId, blockStmts, CmmStmt(..), CmmActuals, CmmFormal, CmmFormals, CmmHintFormals, + CmmSafety(..), CmmCallTarget(..), CmmStatic(..), Section(..), CmmExpr(..), cmmExprRep, @@ -115,11 +116,17 @@ data CmmInfo ClosureTypeTag -- Int ClosureTypeInfo | CmmNonInfo -- Procedure doesn't need an info table + (Maybe BlockId) -- But we still need a GC target for it + +-- TODO: The GC target shouldn't really be part of CmmInfo +-- as it doesn't appear in the resulting info table. +-- It should be factored out. data ClosureTypeInfo = ConstrInfo ClosureLayout ConstrTag ConstrDescription | FunInfo ClosureLayout C_SRT FunType FunArity ArgDescr SlowEntry | ThunkInfo ClosureLayout C_SRT + | ThunkSelectorInfo SelectorOffset C_SRT | ContInfo [Maybe LocalReg] -- Forced stack parameters C_SRT @@ -127,12 +134,15 @@ data ClosureTypeInfo -- TODO: These types may need refinement data ProfilingInfo = ProfilingInfo CmmLit CmmLit -- closure_type, closure_desc type ClosureTypeTag = StgHalfWord -type ClosureLayout = (StgHalfWord, StgHalfWord) -- pts, nptrs +type ClosureLayout = (StgHalfWord, StgHalfWord) -- ptrs, nptrs type ConstrTag = StgHalfWord -type ConstrDescription = CLabel +type ConstrDescription = CmmLit type FunType = StgHalfWord type FunArity = StgHalfWord -type SlowEntry = CLabel +type SlowEntry = CmmLit + -- ^We would like this to be a CLabel but + -- for now the parser sets this to zero on an INFO_TABLE_FUN. +type SelectorOffset = StgWord ----------------------------------------------------------------------------- -- CmmStmt @@ -154,7 +164,7 @@ data CmmStmt CmmCallTarget CmmHintFormals -- zero or more results CmmActuals -- zero or more arguments - C_SRT -- SRT for the continuation of the call + CmmSafety -- whether to build a continuation | CmmBranch BlockId -- branch to another BB in this fn @@ -177,6 +187,7 @@ type CmmActuals = [(CmmActual,MachHint)] type CmmFormal = LocalReg type CmmHintFormals = [(CmmFormal,MachHint)] type CmmFormals = [CmmFormal] +data CmmSafety = CmmUnsafe | CmmSafe C_SRT {- Discussion