From: Pepe Iborra Date: Tue, 13 Feb 2007 20:30:43 +0000 (+0000) Subject: Modify the breakpoint desugaring to introduce more laziness X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=60ade746bb87a5aa76f5d6d2ca97027fc6356dc7;p=ghc-hetmet.git Modify the breakpoint desugaring to introduce more laziness Benchmarks have shown that making the formation of the list of locals more lazy can improve performance of -fdebugging up to 50% in some cases --- diff --git a/compiler/deSugar/DsBreakpoint.lhs b/compiler/deSugar/DsBreakpoint.lhs index 869cde6..07b3ec9 100644 --- a/compiler/deSugar/DsBreakpoint.lhs +++ b/compiler/deSugar/DsBreakpoint.lhs @@ -39,6 +39,7 @@ import Outputable import ErrUtils import FastString import DynFlags +import MkId import DsMonad import {-#SOURCE#-}DsExpr ( dsLExpr ) @@ -77,7 +78,8 @@ mkBreakpointExpr loc bkptFuncId ty = do , HsLit (HsInt (fromIntegral site))] funE = l$ HsVar jumpFuncId ptrE = l (HsLit (HsInt (fromIntegral (I# (addr2Int# addr#))))) - locsE = l locals + locsE = l (HsApp (l(HsWrap (WpTyApp (mkListTy opaqueTy)) (HsVar lazyId))) + (l locals)) locE = l locInfo msgE = l (srcSpanLit loc) return $