X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FStgCmmHeap.hs;h=a02d2e24a373495d57c9c4df82fe8eb907053226;hb=5aeae7aaf9f831a97a55eea61f553795f23a2d1b;hp=ec6095313e479f812f834aab93681eb70c58f96b;hpb=5dd61c6680eb9c2091048cacbfa53ab9e55ddcb6;p=ghc-hetmet.git diff --git a/compiler/codeGen/StgCmmHeap.hs b/compiler/codeGen/StgCmmHeap.hs index ec60953..a02d2e2 100644 --- a/compiler/codeGen/StgCmmHeap.hs +++ b/compiler/codeGen/StgCmmHeap.hs @@ -42,7 +42,6 @@ import CostCentre import Outputable import FastString( LitString, mkFastString, sLit ) import Constants -import Data.List ----------------------------------------------------------- @@ -334,7 +333,7 @@ These are used in the following circumstances -------------------------------------------------------------- -- A heap/stack check at a function or thunk entry point. -entryHeapCheck :: LocalReg -- Function (closure environment) +entryHeapCheck :: Maybe LocalReg -- Function (closure environment) -> Int -- Arity -- not same as length args b/c of voids -> [LocalReg] -- Non-void args (empty for thunk) -> FCode () @@ -344,7 +343,8 @@ entryHeapCheck fun arity args code = do updfr_sz <- getUpdFrameOff heapCheck True (gc_call updfr_sz) code -- The 'fun' keeps relevant CAFs alive where - args' = fun : args + args' = case fun of Just f -> f : args + Nothing -> args arg_exprs = map (CmmReg . CmmLocal) args' gc_call updfr_sz | arity == 0 = mkJumpGC (CmmReg (CmmGlobal GCEnter1)) arg_exprs updfr_sz