X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FCgForeignCall.hs;h=957651d3bae8567b6438eceb65df9ace8fd17c48;hb=81b5698d13d6c4b99ad85dfc2c0fdfafd7a469dd;hp=cf99f316c3e9ddd67aa81514dc7ac6fd82d3c2bf;hpb=497302c44ad08c6c27d0e15d94a787f332c0cfec;p=ghc-hetmet.git diff --git a/compiler/codeGen/CgForeignCall.hs b/compiler/codeGen/CgForeignCall.hs index cf99f31..957651d 100644 --- a/compiler/codeGen/CgForeignCall.hs +++ b/compiler/codeGen/CgForeignCall.hs @@ -94,9 +94,6 @@ emitForeignCall results (CCall (CCallSpec target cconv safety)) args live -- ToDo: this might not be correct for 64-bit API arg_size rep = max (widthInBytes (typeWidth rep)) wORD_SIZE -emitForeignCall _ (DNCall _) _ _ - = panic "emitForeignCall: DNCall" - -- alternative entry point, used by CmmParse emitForeignCall' @@ -212,7 +209,11 @@ emitLoadThreadState = do bWord), -- SpLim = tso->stack + RESERVED_STACK_WORDS; CmmAssign spLim (cmmOffsetW (cmmOffset (CmmReg (CmmLocal tso)) tso_STACK) - rESERVED_STACK_WORDS) + rESERVED_STACK_WORDS), + -- HpAlloc = 0; + -- HpAlloc is assumed to be set to non-zero only by a failed + -- a heap check, see HeapStackCheck.cmm:GC_GENERIC + CmmAssign hpAlloc (CmmLit zeroCLit) ] emitOpenNursery -- and load the current cost centre stack from the TSO when profiling: @@ -267,13 +268,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