diff options
Diffstat (limited to 'src/runtime/haskell')
| -rw-r--r-- | src/runtime/haskell/PGF/Binary.hs | 6 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/ByteCode.hs | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/runtime/haskell/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs index 6f63e63c0..b2695acbb 100644 --- a/src/runtime/haskell/PGF/Binary.hs +++ b/src/runtime/haskell/PGF/Binary.hs @@ -177,7 +177,11 @@ instance Binary Instr where put (DROP n ) = putWord8 64 >> put n
put (JUMP l ) = putWord8 68 >> put l
put (FAIL ) = putWord8 72
- put (ADD ) = putWord8 76
+ put (PUSH_ACCUM (LInt n)) = putWord8 76 >> put n
+ put (PUSH_ACCUM (LStr s)) = putWord8 77 >> put s
+ put (PUSH_ACCUM (LFlt d)) = putWord8 78 >> put d
+ put (POP_ACCUM ) = putWord8 80
+ put (ADD ) = putWord8 84
instance Binary Type where
put (DTyp hypos cat exps) = put (hypos,cat,exps)
diff --git a/src/runtime/haskell/PGF/ByteCode.hs b/src/runtime/haskell/PGF/ByteCode.hs index 9ac072378..579d6b3bb 100644 --- a/src/runtime/haskell/PGF/ByteCode.hs +++ b/src/runtime/haskell/PGF/ByteCode.hs @@ -32,6 +32,8 @@ data Instr | DROP {-# UNPACK #-} !Int | JUMP {-# UNPACK #-} !CodeLabel | FAIL + | PUSH_ACCUM Literal + | POP_ACCUM | ADD data IVal @@ -71,6 +73,8 @@ ppInstr (TUCK v n ) = text "TUCK " <+> ppIVal v <+> int n ppInstr (DROP n ) = text "DROP " <+> int n ppInstr (JUMP l ) = text "JUMP " <+> ppLabel l ppInstr (FAIL ) = text "FAIL" +ppInstr (PUSH_ACCUM lit) = text "PUSH_ACCUM " <+> ppLit lit +ppInstr (POP_ACCUM ) = text "POP_ACCUM" ppInstr (ADD ) = text "ADD" ppIVal (HEAP n) = text "hp" <> parens (int n) |
