X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FCgClosure.lhs;h=8337f916fe46f6aba7451a10f6b1044d2bb5c438;hb=7d6dffe542bdad5707a929ae7ac25813c586766d;hp=1a2cbc5202e0e60333ab78d0dc8b8d0e9140675a;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/codeGen/CgClosure.lhs b/compiler/codeGen/CgClosure.lhs index 1a2cbc5..8337f91 100644 --- a/compiler/codeGen/CgClosure.lhs +++ b/compiler/codeGen/CgClosure.lhs @@ -1,8 +1,7 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgClosure.lhs,v 1.72 2005/05/18 12:06:51 simonmar Exp $ -% \section[CgClosure]{Code generation for closures} This module provides the support code for @StgToAbstractC@ to deal @@ -23,34 +22,29 @@ import {-# SOURCE #-} CgExpr ( cgExpr ) import CgMonad import CgBindery import CgHeapery -import CgStackery ( mkVirtStkOffsets, pushUpdateFrame, getVirtSp, - setRealAndVirtualSp ) -import CgProf ( chooseDynCostCentres, ldvEnter, enterCostCentre, - costCentreFrom ) +import CgStackery +import CgProf import CgTicky -import CgParallel ( granYield, granFetchAndReschedule ) -import CgInfoTbls ( emitClosureCodeAndInfoTable, getSRTInfo ) -import CgCallConv ( assignCallRegs, mkArgDescr ) -import CgUtils ( emitDataLits, addIdReps, cmmRegOffW, - emitRtsCallWithVols ) -import ClosureInfo -- lots and lots of stuff -import SMRep ( CgRep, cgRepSizeW, argMachRep, fixedHdrSize, WordOff, - idCgRep ) -import MachOp ( MachHint(..) ) +import CgParallel +import CgInfoTbls +import CgCallConv +import CgUtils +import ClosureInfo +import SMRep +import MachOp import Cmm -import CmmUtils ( CmmStmts, mkStmts, oneStmt, plusStmts, noStmts, - mkLblExpr ) +import CmmUtils import CLabel import StgSyn -import StaticFlags ( opt_DoTickyProfiling ) +import StaticFlags import CostCentre -import Id ( Id, idName, idType ) -import Name ( Name, isExternalName ) -import Module ( Module, pprModule ) -import ListSetOps ( minusList ) -import Util ( isIn, mapAccumL, zipWithEqual ) -import BasicTypes ( TopLevelFlag(..) ) -import Constants ( oFFSET_StgInd_indirectee, wORD_SIZE ) +import Id +import Name +import Module +import ListSetOps +import Util +import BasicTypes +import Constants import Outputable import FastString \end{code} @@ -79,7 +73,7 @@ cgTopRhsClosure id ccs binder_info srt upd_flag args body = do let name = idName id ; lf_info <- mkClosureLFInfo id TopLevel [] upd_flag args ; srt_info <- getSRTInfo name srt - ; mod_name <- moduleName + ; mod_name <- getModuleName ; let descr = closureDescription mod_name name closure_info = mkClosureInfo True id lf_info 0 0 srt_info descr closure_label = mkLocalClosureLabel name @@ -118,7 +112,7 @@ cgStdRhsClosure bndr cc bndr_info fvs args body lf_info payload = do -- AHA! A STANDARD-FORM THUNK { -- LAY OUT THE OBJECT amodes <- getArgAmodes payload - ; mod_name <- moduleName + ; mod_name <- getModuleName ; let (tot_wds, ptr_wds, amodes_w_offsets) = mkVirtHeapOffsets (isLFThunk lf_info) amodes @@ -169,7 +163,7 @@ cgRhsClosure bndr cc bndr_info srt fvs upd_flag args body = do ; lf_info <- mkClosureLFInfo bndr NotTopLevel fvs upd_flag args ; fv_infos <- mapFCs getCgIdInfo reduced_fvs ; srt_info <- getSRTInfo name srt - ; mod_name <- moduleName + ; mod_name <- getModuleName ; let bind_details :: [(CgIdInfo, VirtualHpOffset)] (tot_wds, ptr_wds, bind_details) = mkVirtHeapOffsets (isLFThunk lf_info) (map add_rep fv_infos) @@ -453,12 +447,12 @@ emitBlackHoleCode is_single_entry -- Profiling needs slop filling (to support LDV profiling), so -- currently eager blackholing doesn't work with profiling. -- - -- TICKY_TICKY needs EAGER_BLACKHOLING to verify no double-entries of - -- single-entry thunks. - eager_blackholing - | opt_DoTickyProfiling = True - | otherwise = False + -- Previously, eager blackholing was enabled when ticky-ticky + -- was on. But it didn't work, and it wasn't strictly necessary + -- to bring back minimal ticky-ticky, so now EAGER_BLACKHOLING + -- is unconditionally disabled. -- krc 1/2007 + eager_blackholing = False \end{code} \begin{code} @@ -481,17 +475,9 @@ setupUpdate closure_info code ; if closureUpdReqd closure_info then do -- Blackhole the (updatable) CAF: { upd_closure <- link_caf closure_info True - ; pushUpdateFrame upd_closure code } + ; pushUpdateFrame upd_closure code } else do - { -- No update reqd, you'd think we don't need to - -- black-hole it. But when ticky-ticky is on, we - -- black-hole it regardless, to catch errors in which - -- an allegedly single-entry closure is entered twice - -- - -- We discard the pointer returned by link_caf, because - -- we don't push an update frame - whenC opt_DoTickyProfiling -- Blackhole even a SE CAF - (link_caf closure_info False >> nopC) + { -- krc: removed some ticky-related code here. ; tickyUpdateFrameOmitted ; code } }