X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FByteCodeInstr.lhs;h=5239139eb2234d60440a771d7e4314e36772d4c9;hb=84923cc7de2a93c22a2f72daf9ac863959efae13;hp=7bd4408fff66895ef648332df7649ac74a236a9b;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/ghci/ByteCodeInstr.lhs b/compiler/ghci/ByteCodeInstr.lhs index 7bd4408..5239139 100644 --- a/compiler/ghci/ByteCodeInstr.lhs +++ b/compiler/ghci/ByteCodeInstr.lhs @@ -1,7 +1,7 @@ % -% (c) The University of Glasgow 2000 +% (c) The University of Glasgow 2000-2006 % -\section[ByteCodeInstrs]{Bytecode instruction definitions} +ByteCodeInstrs: Bytecode instruction definitions \begin{code} module ByteCodeInstr ( @@ -11,16 +11,19 @@ module ByteCodeInstr ( #include "HsVersions.h" #include "../includes/MachDeps.h" +import ByteCodeItbls ( ItblPtr ) + import Outputable -import Name ( Name ) -import Id ( Id ) +import Name +import Id import CoreSyn -import PprCore ( pprCoreExpr, pprCoreAlt ) -import Literal ( Literal ) -import DataCon ( DataCon ) -import VarSet ( VarSet ) -import PrimOp ( PrimOp ) -import SMRep ( StgWord, CgRep ) +import PprCore +import Literal +import DataCon +import VarSet +import PrimOp +import SMRep + import GHC.Ptr -- ---------------------------------------------------------------------------- @@ -37,7 +40,7 @@ data ProtoBCO a -- what the BCO came from protoBCOExpr :: Either [AnnAlt Id VarSet] (AnnExpr Id VarSet), -- malloc'd pointers - protoBCOPtrs :: [Ptr ()] + protoBCOPtrs :: [Either ItblPtr (Ptr ())] } type LocalLabel = Int @@ -170,6 +173,8 @@ instance Outputable BCInstr where ppr (ALLOC_PAP arity sz) = text "ALLOC_PAP " <+> int arity <+> int sz ppr (MKAP offset sz) = text "MKAP " <+> int sz <+> text "words," <+> int offset <+> text "stkoff" + ppr (MKPAP offset sz) = text "MKPAP " <+> int sz <+> text "words," + <+> int offset <+> text "stkoff" ppr (UNPACK sz) = text "UNPACK " <+> int sz ppr (PACK dcon sz) = text "PACK " <+> ppr dcon <+> ppr sz ppr (LABEL lab) = text "__" <> int lab <> colon @@ -181,16 +186,16 @@ instance Outputable BCInstr where ppr (TESTEQ_D d lab) = text "TESTEQ_D" <+> double d <+> text "__" <> int lab ppr (TESTLT_P i lab) = text "TESTLT_P" <+> int i <+> text "__" <> int lab ppr (TESTEQ_P i lab) = text "TESTEQ_P" <+> int i <+> text "__" <> int lab - ppr (JMP lab) = text "JMP" <+> int lab ppr CASEFAIL = text "CASEFAIL" - ppr ENTER = text "ENTER" - ppr RETURN = text "RETURN" - ppr (RETURN_UBX pk) = text "RETURN_UBX " <+> ppr pk + ppr (JMP lab) = text "JMP" <+> int lab ppr (CCALL off marshall_addr) = text "CCALL " <+> int off <+> text "marshall code at" <+> text (show marshall_addr) ppr (SWIZZLE stkoff n) = text "SWIZZLE " <+> text "stkoff" <+> int stkoff <+> text "by" <+> int n + ppr ENTER = text "ENTER" + ppr RETURN = text "RETURN" + ppr (RETURN_UBX pk) = text "RETURN_UBX " <+> ppr pk -- ----------------------------------------------------------------------------- -- The stack use, in words, of each bytecode insn. These _must_ be