%
-% (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 (
#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
-- ----------------------------------------------------------------------------
-- 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
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
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