X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcodeGen%2FCgStackery.lhs;h=a75b7e758334a7a7a36da9d23e4ec2eaef5d4153;hb=96287c06a2bd86bd6175a08fc8d8ddd8e9b20c17;hp=3a2598ef2bcaa1e2a29ea19161543a935db591f4;hpb=205383c22a13b39ed2fb9d9512d92927e53edf31;p=ghc-hetmet.git diff --git a/ghc/compiler/codeGen/CgStackery.lhs b/ghc/compiler/codeGen/CgStackery.lhs index 3a2598e..a75b7e7 100644 --- a/ghc/compiler/codeGen/CgStackery.lhs +++ b/ghc/compiler/codeGen/CgStackery.lhs @@ -1,7 +1,7 @@ % % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgStackery.lhs,v 1.18 2001/08/31 12:39:06 rje Exp $ +% $Id: CgStackery.lhs,v 1.20 2001/10/03 13:57:42 simonmar Exp $ % \section[CgStackery]{Stack management functions} @@ -27,9 +27,11 @@ import AbsCUtils ( mkAbstractCs, getAmodeRep ) import PrimRep ( getPrimRepSize, PrimRep(..), isFollowableRep ) import CmdLineOpts ( opt_SccProfilingOn, opt_GranMacros ) import Panic ( panic ) -import Constants ( uF_SIZE, sCC_UF_SIZE, gRAN_UF_SIZE, - sEQ_FRAME_SIZE, sCC_SEQ_FRAME_SIZE, gRAN_SEQ_FRAME_SIZE ) +import Constants ( uF_SIZE, pROF_UF_SIZE, gRAN_UF_SIZE, + sEQ_FRAME_SIZE, pROF_SEQ_FRAME_SIZE, + gRAN_SEQ_FRAME_SIZE ) +import Util ( sortLt ) import IOExts ( trace ) \end{code} @@ -221,11 +223,11 @@ getFinalStackHW fcode = do \end{code} \begin{code} -updateFrameSize | opt_SccProfilingOn = sCC_UF_SIZE +updateFrameSize | opt_SccProfilingOn = pROF_UF_SIZE | opt_GranMacros = trace ("updateFrameSize = " ++ (show gRAN_UF_SIZE))gRAN_UF_SIZE | otherwise = uF_SIZE -seqFrameSize | opt_SccProfilingOn = sCC_SEQ_FRAME_SIZE +seqFrameSize | opt_SccProfilingOn = pROF_SEQ_FRAME_SIZE | opt_GranMacros = gRAN_SEQ_FRAME_SIZE | otherwise = sEQ_FRAME_SIZE \end{code} @@ -242,7 +244,7 @@ Explicitly free some stack space. addFreeStackSlots :: [VirtualSpOffset] -> Slot -> Code addFreeStackSlots extra_free slot = do ((vsp, free, real, hw),heap_usage) <- getUsage - let all_free = addFreeSlots free (zip extra_free (repeat slot)) + let all_free = addFreeSlots free (zip (sortLt (<) extra_free) (repeat slot)) let (new_vsp, new_free) = trim vsp all_free let new_usage = ((new_vsp, new_free, real, hw), heap_usage) setUsage new_usage