X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FByteCodeGen.lhs;h=12b6f295368614c90cf8a1471df8ea5bd3b5c059;hb=aa162076d849966c54159410422a84c95e00340e;hp=170a85c37cdd9b0ff49f44f4e86669fae2daecc8;hpb=46e4022ba03747cafaace3c9d49c7d94904f665f;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/ByteCodeGen.lhs b/ghc/compiler/ghci/ByteCodeGen.lhs index 170a85c..12b6f29 100644 --- a/ghc/compiler/ghci/ByteCodeGen.lhs +++ b/ghc/compiler/ghci/ByteCodeGen.lhs @@ -48,9 +48,9 @@ import Constants ( wORD_SIZE ) import ByteCodeInstr ( BCInstr(..), ProtoBCO(..), nameOfProtoBCO, bciStackUse ) import ByteCodeItbls ( ItblEnv, mkITbls ) import ByteCodeLink ( UnlinkedBCO, UnlinkedBCOExpr, assembleBCO, - ClosureEnv, HValue, filterNameMap, + ClosureEnv, HValue, filterNameMap, linkFail, iNTERP_STACK_CHECK_THRESH ) -import ByteCodeFFI ( taggedSizeW, untaggedSizeW, mkMarshalCode ) +import ByteCodeFFI ( taggedSizeW, untaggedSizeW, mkMarshalCode, moan64 ) import Linker ( lookupSymbol ) import List ( intersperse, sortBy, zip4 ) @@ -765,16 +765,14 @@ generateCCall d0 s p ccall_spec@(CCallSpec target cconv safety) fn args_r_to_l DynamicTarget -> returnBc (False, panic "ByteCodeGen.generateCCall(dyn)") StaticTarget target - -> ioToBc (lookupSymbol (_UNPK_ target)) `thenBc` \res -> + -> let sym_to_find = _UNPK_ target in + ioToBc (lookupSymbol sym_to_find) `thenBc` \res -> case res of Just aa -> case aa of Ptr a# -> returnBc (True, A# a#) - Nothing -> returnBc invalid + Nothing -> ioToBc (linkFail "ByteCodeGen.generateCCall" + sym_to_find) CasmTarget _ - -> returnBc invalid - where - invalid = pprPanic ("ByteCodeGen.generateCCall: unfindable " - ++ "symbol or otherwise invalid target") - (ppr ccall_spec) + -> pprPanic "ByteCodeGen.generateCCall: casm" (ppr ccall_spec) in get_target_info `thenBc` \ (is_static, static_target_addr) -> let @@ -840,10 +838,11 @@ mkDummyLiteral pr = case pr of CharRep -> MachChar 0 IntRep -> MachInt 0 + WordRep -> MachWord 0 DoubleRep -> MachDouble 0 FloatRep -> MachFloat 0 AddrRep | taggedSizeW AddrRep == taggedSizeW WordRep -> MachWord 0 - _ -> pprPanic "mkDummyLiteral" (ppr pr) + _ -> moan64 "mkDummyLiteral" (ppr pr) -- Convert (eg) @@ -980,7 +979,7 @@ mkUnpackCode vars d p | npr `elem` [IntRep, WordRep, FloatRep, DoubleRep, CharRep, AddrRep] = approved | otherwise - = pprPanic "ByteCodeGen.mkUnpackCode" (ppr npr) + = moan64 "ByteCodeGen.mkUnpackCode" (ppr npr) where approved = UPK_TAG usizeW (off_h-usizeW) off_s `consOL` theRest theRest = do_nptrs (off_h-usizeW) (off_s + tsizeW) nprs