[project @ 2001-08-09 10:54:13 by sewardj]
[ghc-hetmet.git] / ghc / compiler / ghci / ByteCodeInstr.lhs
index dcc96d9..7a965a1 100644 (file)
@@ -101,6 +101,8 @@ data BCInstr
 
    -- For doing calls to C (via glue code generated by ByteCodeFFI)
    | CCALL            Addr     -- of the glue code
+   | SWIZZLE          Int Int  -- to the ptr N words down the stack,
+                               -- add M (interpreted as a signed 16-bit entity)
 
    -- To Infinity And Beyond
    | ENTER
@@ -156,6 +158,8 @@ instance Outputable BCInstr where
    ppr (RETURN pk)           = text "RETURN  " <+> ppr pk
    ppr (CCALL marshall_addr) = text "CCALL   " <+> text "marshall code at" 
                                                <+> text (show marshall_addr)
+   ppr (SWIZZLE stkoff n)    = text "SWIZZLE " <+> text "stkoff" <+> int stkoff 
+                                               <+> text "by" <+> int n 
 
 -- The stack use, in words, of each bytecode insn.  These _must_ be
 -- correct, or overestimates of reality, to be safe.
@@ -186,6 +190,7 @@ bciStackUse (JMP lab)             = 0
 bciStackUse ENTER                 = 0
 bciStackUse (RETURN pk)           = 0
 bciStackUse (CCALL marshall_addr) = 0
+bciStackUse (SWIZZLE stkoff n)    = 0
 
 -- These insns actually reduce stack use, but we need the high-tide level,
 -- so can't use this info.  Not that it matters much.