summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-11-05 14:49:05 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-11-05 14:51:06 +0000
commit9f68cceca364600e2ed8d8b4c9e2684eb83549fc (patch)
tree632ca1126429dd0ff3ca42c327d5c81a43cf5b73 /compiler/codeGen
parenta307ad56e0a5568d4b9f2c446ba33fcc42f39f47 (diff)
downloadhaskell-9f68cceca364600e2ed8d8b4c9e2684eb83549fc.tar.gz
loadThreadState should set HpAlloc=0
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/StgCmmForeign.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs
index 7612cd1a49..aef1e4f792 100644
--- a/compiler/codeGen/StgCmmForeign.hs
+++ b/compiler/codeGen/StgCmmForeign.hs
@@ -306,6 +306,11 @@ loadThreadState dflags tso stack = do
-- SpLim = stack->stack + RESERVED_STACK_WORDS;
mkAssign spLim (cmmOffsetW dflags (cmmOffset dflags (CmmReg (CmmLocal stack)) (stack_STACK dflags))
(rESERVED_STACK_WORDS dflags)),
+ -- HpAlloc = 0;
+ -- HpAlloc is assumed to be set to non-zero only by a failed
+ -- a heap check, see HeapStackCheck.cmm:GC_GENERIC
+ mkAssign hpAlloc (zeroExpr dflags),
+
openNursery dflags,
-- and load the current cost centre stack from the TSO when profiling:
if gopt Opt_SccProfilingOn dflags then
@@ -367,13 +372,14 @@ stgHp = CmmReg hp
stgCurrentTSO = CmmReg currentTSO
stgCurrentNursery = CmmReg currentNursery
-sp, spLim, hp, hpLim, currentTSO, currentNursery :: CmmReg
+sp, spLim, hp, hpLim, currentTSO, currentNursery, hpAlloc :: CmmReg
sp = CmmGlobal Sp
spLim = CmmGlobal SpLim
hp = CmmGlobal Hp
hpLim = CmmGlobal HpLim
currentTSO = CmmGlobal CurrentTSO
currentNursery = CmmGlobal CurrentNursery
+hpAlloc = CmmGlobal HpAlloc
-- -----------------------------------------------------------------------------
-- For certain types passed to foreign calls, we adjust the actual