X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FCgCallConv.hs;h=f463255807ac2580ca2702d7b0a8debce94996dc;hb=04db0e9fa47ce4dfbcb73ec1752d94195f3b394e;hp=fa98f96378f9fc40eeb4ddb83ad800b683508ce6;hpb=423d477bfecd490de1449c59325c8776f91d7aac;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/CgCallConv.hs b/ghc/compiler/codeGen/CgCallConv.hs index fa98f96..f463255 100644 --- a/ghc/compiler/codeGen/CgCallConv.hs +++ b/ghc/compiler/codeGen/CgCallConv.hs @@ -57,8 +57,8 @@ import Name ( Name ) import TyCon ( TyCon, tyConFamilySize ) import Bitmap ( Bitmap, mAX_SMALL_BITMAP_SIZE, mkBitmap, intsToReverseBitmap ) -import Util ( isn'tIn, sortLt ) -import CmdLineOpts ( opt_Unregisterised ) +import Util ( isn'tIn, sortLe ) +import StaticFlags ( opt_Unregisterised ) import FastString ( LitString ) import Outputable import DATA_BITS @@ -108,6 +108,8 @@ argBits (PtrArg : args) = False : argBits args argBits (arg : args) = take (cgRepSizeW arg) (repeat True) ++ argBits args stdPattern :: [CgRep] -> Maybe Int +stdPattern [] = Just ARG_NONE -- just void args, probably + stdPattern [PtrArg] = Just ARG_P stdPattern [FloatArg] = Just ARG_F stdPattern [DoubleArg] = Just ARG_D @@ -204,17 +206,20 @@ mkRegLiveness regs ptrs nptrs -- For a slow call, we must take a bunch of arguments and intersperse -- some stg_ap__ret_info return addresses. -constructSlowCall :: [(CgRep,CmmExpr)] -> (CLabel, [(CgRep,CmmExpr)]) +constructSlowCall + :: [(CgRep,CmmExpr)] + -> (CLabel, -- RTS entry point for call + [(CgRep,CmmExpr)], -- args to pass to the entry point + [(CgRep,CmmExpr)]) -- stuff to save on the stack + -- don't forget the zero case constructSlowCall [] - = (stg_ap_0, []) - where - stg_ap_0 = enterRtsRetLabel SLIT("stg_ap_0") + = (mkRtsApFastLabel SLIT("stg_ap_0"), [], []) constructSlowCall amodes - = (stg_ap_pat, these ++ slowArgs rest) + = (stg_ap_pat, these, rest) where - stg_ap_pat = enterRtsRetLabel arg_pat + stg_ap_pat = mkRtsApFastLabel arg_pat (arg_pat, these, rest) = matchSlowPattern amodes enterRtsRetLabel arg_pat @@ -350,7 +355,7 @@ buildContLiveness name live_slots -- (subtract one for the frame-header = return address). rel_slots :: [WordOff] - rel_slots = sortLt (<) + rel_slots = sortLe (<=) [ start_sp - ofs -- Get slots relative to top of frame | ofs <- live_slots ]