packages feed

lua-bc 0.1.0.2 → 0.1.0.3

raw patch · 4 files changed

+142/−138 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Language.Lua.Bytecode: Chunk :: Int -> Function -> Chunk
+ Language.Lua.Bytecode: Chunk :: !Int -> Function -> Chunk
- Language.Lua.Bytecode: CountInt :: Int -> Count
+ Language.Lua.Bytecode: CountInt :: !Int -> Count
- Language.Lua.Bytecode: OP_ADD :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_ADD :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_BAND :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_BAND :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_BNOT :: Reg -> Reg -> OpCode
+ Language.Lua.Bytecode: OP_BNOT :: !Reg -> !Reg -> OpCode
- Language.Lua.Bytecode: OP_BOR :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_BOR :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_BXOR :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_BXOR :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_CALL :: Reg -> Count -> Count -> OpCode
+ Language.Lua.Bytecode: OP_CALL :: !Reg -> !Count -> !Count -> OpCode
- Language.Lua.Bytecode: OP_CLOSURE :: Reg -> ProtoIx -> OpCode
+ Language.Lua.Bytecode: OP_CLOSURE :: !Reg -> !ProtoIx -> OpCode
- Language.Lua.Bytecode: OP_CONCAT :: Reg -> Reg -> Reg -> OpCode
+ Language.Lua.Bytecode: OP_CONCAT :: !Reg -> !Reg -> !Reg -> OpCode
- Language.Lua.Bytecode: OP_DIV :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_DIV :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_EQ :: Bool -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_EQ :: !Bool -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_EXTRAARG :: Int -> OpCode
+ Language.Lua.Bytecode: OP_EXTRAARG :: !Int -> OpCode
- Language.Lua.Bytecode: OP_FORLOOP :: Reg -> Int -> OpCode
+ Language.Lua.Bytecode: OP_FORLOOP :: !Reg -> !Int -> OpCode
- Language.Lua.Bytecode: OP_FORPREP :: Reg -> Int -> OpCode
+ Language.Lua.Bytecode: OP_FORPREP :: !Reg -> !Int -> OpCode
- Language.Lua.Bytecode: OP_GETTABLE :: Reg -> Reg -> RK -> OpCode
+ Language.Lua.Bytecode: OP_GETTABLE :: !Reg -> !Reg -> !RK -> OpCode
- Language.Lua.Bytecode: OP_GETTABUP :: Reg -> UpIx -> RK -> OpCode
+ Language.Lua.Bytecode: OP_GETTABUP :: !Reg -> !UpIx -> !RK -> OpCode
- Language.Lua.Bytecode: OP_GETUPVAL :: Reg -> UpIx -> OpCode
+ Language.Lua.Bytecode: OP_GETUPVAL :: !Reg -> !UpIx -> OpCode
- Language.Lua.Bytecode: OP_IDIV :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_IDIV :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_JMP :: (Maybe Reg) -> Int -> OpCode
+ Language.Lua.Bytecode: OP_JMP :: !(Maybe Reg) -> !Int -> OpCode
- Language.Lua.Bytecode: OP_LE :: Bool -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_LE :: !Bool -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_LEN :: Reg -> Reg -> OpCode
+ Language.Lua.Bytecode: OP_LEN :: !Reg -> !Reg -> OpCode
- Language.Lua.Bytecode: OP_LOADBOOL :: Reg -> Bool -> Bool -> OpCode
+ Language.Lua.Bytecode: OP_LOADBOOL :: !Reg -> !Bool -> !Bool -> OpCode
- Language.Lua.Bytecode: OP_LOADK :: Reg -> Kst -> OpCode
+ Language.Lua.Bytecode: OP_LOADK :: !Reg -> !Kst -> OpCode
- Language.Lua.Bytecode: OP_LOADKX :: Reg -> OpCode
+ Language.Lua.Bytecode: OP_LOADKX :: !Reg -> OpCode
- Language.Lua.Bytecode: OP_LOADNIL :: Reg -> Int -> OpCode
+ Language.Lua.Bytecode: OP_LOADNIL :: !Reg -> !Int -> OpCode
- Language.Lua.Bytecode: OP_LT :: Bool -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_LT :: !Bool -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_MOD :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_MOD :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_MOVE :: Reg -> Reg -> OpCode
+ Language.Lua.Bytecode: OP_MOVE :: !Reg -> !Reg -> OpCode
- Language.Lua.Bytecode: OP_MUL :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_MUL :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_NEWTABLE :: Reg -> Int -> Int -> OpCode
+ Language.Lua.Bytecode: OP_NEWTABLE :: !Reg -> !Int -> !Int -> OpCode
- Language.Lua.Bytecode: OP_NOT :: Reg -> Reg -> OpCode
+ Language.Lua.Bytecode: OP_NOT :: !Reg -> !Reg -> OpCode
- Language.Lua.Bytecode: OP_POW :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_POW :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_RETURN :: Reg -> Count -> OpCode
+ Language.Lua.Bytecode: OP_RETURN :: !Reg -> !Count -> OpCode
- Language.Lua.Bytecode: OP_SELF :: Reg -> Reg -> RK -> OpCode
+ Language.Lua.Bytecode: OP_SELF :: !Reg -> !Reg -> !RK -> OpCode
- Language.Lua.Bytecode: OP_SETLIST :: Reg -> Int -> Int -> OpCode
+ Language.Lua.Bytecode: OP_SETLIST :: !Reg -> !Int -> !Int -> OpCode
- Language.Lua.Bytecode: OP_SETTABLE :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_SETTABLE :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_SETTABUP :: UpIx -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_SETTABUP :: !UpIx -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_SETUPVAL :: Reg -> UpIx -> OpCode
+ Language.Lua.Bytecode: OP_SETUPVAL :: !Reg -> !UpIx -> OpCode
- Language.Lua.Bytecode: OP_SHL :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_SHL :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_SHR :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_SHR :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_SUB :: Reg -> RK -> RK -> OpCode
+ Language.Lua.Bytecode: OP_SUB :: !Reg -> !RK -> !RK -> OpCode
- Language.Lua.Bytecode: OP_TAILCALL :: Reg -> Count -> Count -> OpCode
+ Language.Lua.Bytecode: OP_TAILCALL :: !Reg -> !Count -> !Count -> OpCode
- Language.Lua.Bytecode: OP_TEST :: Reg -> Bool -> OpCode
+ Language.Lua.Bytecode: OP_TEST :: !Reg -> !Bool -> OpCode
- Language.Lua.Bytecode: OP_TESTSET :: Reg -> Reg -> Bool -> OpCode
+ Language.Lua.Bytecode: OP_TESTSET :: !Reg -> !Reg -> !Bool -> OpCode
- Language.Lua.Bytecode: OP_TFORCALL :: Reg -> Int -> OpCode
+ Language.Lua.Bytecode: OP_TFORCALL :: !Reg -> !Int -> OpCode
- Language.Lua.Bytecode: OP_TFORLOOP :: Reg -> Int -> OpCode
+ Language.Lua.Bytecode: OP_TFORLOOP :: !Reg -> !Int -> OpCode
- Language.Lua.Bytecode: OP_UNM :: Reg -> Reg -> OpCode
+ Language.Lua.Bytecode: OP_UNM :: !Reg -> !Reg -> OpCode
- Language.Lua.Bytecode: OP_VARARG :: Reg -> Count -> OpCode
+ Language.Lua.Bytecode: OP_VARARG :: !Reg -> !Count -> OpCode
- Language.Lua.Bytecode: RK_Kst :: Kst -> RK
+ Language.Lua.Bytecode: RK_Kst :: !Kst -> RK
- Language.Lua.Bytecode: RK_Reg :: Reg -> RK
+ Language.Lua.Bytecode: RK_Reg :: !Reg -> RK

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+0.1.0.3+---+* Unpack opcode fields+ 0.1.0.2 --- 
lua-bc.cabal view
@@ -1,5 +1,5 @@ name:                lua-bc-version:             0.1.0.2+version:             0.1.0.3 synopsis:            Lua bytecode parser description:         Lua bytecode parser license:             MIT
src/Language/Lua/Bytecode.hs view
@@ -21,78 +21,78 @@ newtype Kst = Kst Int  deriving (Read,Show,Eq,Ord) -data RK = RK_Reg Reg | RK_Kst Kst+data RK = RK_Reg !Reg | RK_Kst !Kst  deriving (Read,Show,Eq,Ord) -data Chunk = Chunk Int Function -- ^ number of upvalues and function body+data Chunk = Chunk !Int Function -- ^ number of upvalues and function body  deriving (Read,Show,Eq)  data OpCode-  = OP_MOVE     Reg Reg         {- ^    A B     R(A) := R(B)                                    -}-  | OP_LOADK    Reg Kst         {- ^    A Bx    R(A) := Kst(Bx)                                 -}-  | OP_LOADKX   Reg             {- ^    A       R(A) := Kst(extra arg)                          -}-  | OP_LOADBOOL Reg Bool Bool   {- ^    A B C   R(A) := (Bool)B; if (C) pc++                    -}-  | OP_LOADNIL  Reg Int         {- ^    A B     R(A), R(A+1), ..., R(A+B) := nil                -}-  | OP_GETUPVAL Reg UpIx        {- ^    A B     R(A) := UpValue[B]                              -}+  = OP_MOVE     !Reg !Reg       {- ^    A B     R(A) := R(B)                                    -}+  | OP_LOADK    !Reg !Kst       {- ^    A Bx    R(A) := Kst(Bx)                                 -}+  | OP_LOADKX   !Reg            {- ^    A       R(A) := Kst(extra arg)                          -}+  | OP_LOADBOOL !Reg !Bool !Bool{- ^    A B C   R(A) := (Bool)B; if (C) pc++                    -}+  | OP_LOADNIL  !Reg !Int       {- ^    A B     R(A), R(A+1), ..., R(A+B) := nil                -}+  | OP_GETUPVAL !Reg !UpIx      {- ^    A B     R(A) := UpValue[B]                              -} -  | OP_GETTABUP Reg UpIx RK     {- ^    A B C   R(A) := UpValue[B][RK(C)]                       -}-  | OP_GETTABLE Reg Reg RK      {- ^    A B C   R(A) := R(B)[RK(C)]                             -}+  | OP_GETTABUP !Reg !UpIx !RK  {- ^    A B C   R(A) := UpValue[B][RK(C)]                       -}+  | OP_GETTABLE !Reg !Reg !RK   {- ^    A B C   R(A) := R(B)[RK(C)]                             -} -  | OP_SETTABUP UpIx RK RK      {- ^     A B C   UpValue[A][RK(B)] := RK(C)                      -}-  | OP_SETUPVAL Reg UpIx        {- ^     A B     UpValue[B] := R(A)                              -}-  | OP_SETTABLE Reg RK RK       {- ^    A B C   R(A)[RK(B)] := RK(C)                            -}+  | OP_SETTABUP !UpIx !RK !RK   {- ^     A B C   UpValue[A][RK(B)] := RK(C)                     -}+  | OP_SETUPVAL !Reg !UpIx      {- ^     A B     UpValue[B] := R(A)                             -}+  | OP_SETTABLE !Reg !RK !RK    {- ^    A B C   R(A)[RK(B)] := RK(C)                            -} -  | OP_NEWTABLE Reg Int Int     {- ^    A B C   R(A) := {} (size = B,C)                         -}+  | OP_NEWTABLE !Reg !Int !Int  {- ^    A B C   R(A) := {} (size = B,C)                         -} -  | OP_SELF     Reg Reg RK      {- ^    A B C   R(A+1) := R(B); R(A) := R(B)[RK(C)]             -}+  | OP_SELF     !Reg !Reg !RK   {- ^    A B C   R(A+1) := R(B); R(A) := R(B)[RK(C)]             -} -  | OP_ADD      Reg RK RK       {- ^    A B C   R(A) := RK(B) + RK(C)                           -}-  | OP_SUB      Reg RK RK       {- ^    A B C   R(A) := RK(B) - RK(C)                           -}-  | OP_MUL      Reg RK RK       {- ^    A B C   R(A) := RK(B) * RK(C)                           -}-  | OP_MOD      Reg RK RK       {- ^    A B C   R(A) := RK(B) % RK(C)                           -}-  | OP_POW      Reg RK RK       {- ^    A B C   R(A) := RK(B) ^ RK(C)                           -}-  | OP_DIV      Reg RK RK       {- ^    A B C   R(A) := RK(B) / RK(C)                           -}-  | OP_IDIV     Reg RK RK       {- ^    A B C   R(A) := RK(B) // RK(C)                          -}-  | OP_BAND     Reg RK RK       {- ^    A B C   R(A) := RK(B) & RK(C)                           -}-  | OP_BOR      Reg RK RK       {- ^    A B C   R(A) := RK(B) | RK(C)                           -}-  | OP_BXOR     Reg RK RK       {- ^    A B C   R(A) := RK(B) ~ RK(C)                           -}-  | OP_SHL      Reg RK RK       {- ^    A B C   R(A) := RK(B) << RK(C)                          -}-  | OP_SHR      Reg RK RK       {- ^    A B C   R(A) := RK(B) >> RK(C)                          -}-  | OP_UNM      Reg Reg         {- ^    A B     R(A) := -R(B)                                   -}-  | OP_BNOT     Reg Reg         {- ^    A B     R(A) := ~R(B)                                   -}-  | OP_NOT      Reg Reg         {- ^    A B     R(A) := not R(B)                                -}-  | OP_LEN      Reg Reg         {- ^    A B     R(A) := length of R(B)                          -}+  | OP_ADD      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) + RK(C)                           -}+  | OP_SUB      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) - RK(C)                           -}+  | OP_MUL      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) * RK(C)                           -}+  | OP_MOD      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) % RK(C)                           -}+  | OP_POW      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) ^ RK(C)                           -}+  | OP_DIV      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) / RK(C)                           -}+  | OP_IDIV     !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) // RK(C)                          -}+  | OP_BAND     !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) & RK(C)                           -}+  | OP_BOR      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) | RK(C)                           -}+  | OP_BXOR     !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) ~ RK(C)                           -}+  | OP_SHL      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) << RK(C)                          -}+  | OP_SHR      !Reg !RK !RK    {- ^    A B C   R(A) := RK(B) >> RK(C)                          -}+  | OP_UNM      !Reg !Reg       {- ^    A B     R(A) := -R(B)                                   -}+  | OP_BNOT     !Reg !Reg       {- ^    A B     R(A) := ~R(B)                                   -}+  | OP_NOT      !Reg !Reg       {- ^    A B     R(A) := not R(B)                                -}+  | OP_LEN      !Reg !Reg       {- ^    A B     R(A) := length of R(B)                          -} -  | OP_CONCAT   Reg Reg Reg     {- ^    A B C   R(A) := R(B).. ... ..R(C)                       -}+  | OP_CONCAT   !Reg !Reg !Reg  {- ^    A B C   R(A) := R(B).. ... ..R(C)                       -} -  | OP_JMP      (Maybe Reg) Int {- ^    A sBx   pc+=sBx; if (A) close all upvalues >= R(A - 1)  -}-  | OP_EQ       Bool RK RK      {- ^    A B C   if ((RK(B) == RK(C)) ~= A) then pc++            -}-  | OP_LT       Bool RK RK      {- ^    A B C   if ((RK(B) <  RK(C)) ~= A) then pc++            -}-  | OP_LE       Bool RK RK      {- ^    A B C   if ((RK(B) <= RK(C)) ~= A) then pc++            -}+  | OP_JMP      !(Maybe Reg) !Int {- ^    A sBx   pc+=sBx; if (A) close all upvalues >= R(A - 1)  -}+  | OP_EQ       !Bool !RK !RK     {- ^    A B C   if ((RK(B) == RK(C)) ~= A) then pc++            -}+  | OP_LT       !Bool !RK !RK     {- ^    A B C   if ((RK(B) <  RK(C)) ~= A) then pc++            -}+  | OP_LE       !Bool !RK !RK     {- ^    A B C   if ((RK(B) <= RK(C)) ~= A) then pc++            -} -  | OP_TEST     Reg Bool        {- ^    A C     if not (R(A) <=> C) then pc++                   -}-  | OP_TESTSET  Reg Reg Bool    {- ^    A B C   if (R(B) <=> C) then R(A) := R(B) else pc++     -}+  | OP_TEST     !Reg !Bool      {- ^    A C     if not (R(A) <=> C) then pc++                   -}+  | OP_TESTSET  !Reg !Reg !Bool {- ^    A B C   if (R(B) <=> C) then R(A) := R(B) else pc++     -} -  | OP_CALL     Reg Count Count {- ^    A B C   R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) -}-  | OP_TAILCALL Reg Count Count {- ^    A B C   return R(A)(R(A+1), ... ,R(A+B-1))              -}-  | OP_RETURN   Reg Count       {- ^    A B     return R(A), ... ,R(A+B-2)      (see note)      -}+  | OP_CALL     !Reg !Count !Count {- ^    A B C   R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) -}+  | OP_TAILCALL !Reg !Count !Count {- ^    A B C   return R(A)(R(A+1), ... ,R(A+B-1))              -}+  | OP_RETURN   !Reg !Count       {- ^    A B     return R(A), ... ,R(A+B-2)      (see note)      -} -  | OP_FORLOOP  Reg Int         {- ^    A sBx   R(A)+=R(A+2); if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }-}-  | OP_FORPREP  Reg Int         {- ^    A sBx   R(A)-=R(A+2); pc+=sBx                           -}+  | OP_FORLOOP  !Reg !Int         {- ^    A sBx   R(A)+=R(A+2); if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }-}+  | OP_FORPREP  !Reg !Int         {- ^    A sBx   R(A)-=R(A+2); pc+=sBx                           -} -  | OP_TFORCALL Reg Int         {- ^    A C     R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));  -}-  | OP_TFORLOOP Reg Int         {- ^    A sBx   if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }-}+  | OP_TFORCALL !Reg !Int         {- ^    A C     R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));  -}+  | OP_TFORLOOP !Reg !Int         {- ^    A sBx   if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }-} -  | OP_SETLIST  Reg Int Int   {- ^    A B C   R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B        -}+  | OP_SETLIST  !Reg !Int !Int   {- ^    A B C   R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B        -} -  | OP_CLOSURE  Reg ProtoIx     {- ^    A Bx    R(A) := closure(KPROTO[Bx])                     -}+  | OP_CLOSURE  !Reg !ProtoIx     {- ^    A Bx    R(A) := closure(KPROTO[Bx])                     -} -  | OP_VARARG   Reg Count {- ^    A B     R(A), R(A+1), ..., R(A+B-2) = vararg            -}+  | OP_VARARG   !Reg !Count {- ^    A B     R(A), R(A+1), ..., R(A+B-2) = vararg            -} -  | OP_EXTRAARG Int             {- ^    Ax      extra (larger) argument for previous opcode     -}+  | OP_EXTRAARG !Int             {- ^    Ax      extra (larger) argument for previous opcode     -}   deriving (Read, Show, Eq, Ord) -data Count = CountInt Int | CountTop+data Count = CountInt !Int | CountTop   deriving (Read, Show, Eq, Ord)  data Function = Function
src/Language/Lua/Bytecode/Parser.hs view
@@ -466,63 +466,63 @@               | otherwise            = RK_Reg (Reg x)          sBx = bx - ((1 `shiftL` (size_Bx-1)) - 1)      case op of-       0  -> return $ OP_MOVE (Reg a) (Reg b)-       1  -> return $ OP_LOADK (Reg a) (Kst bx)-       2  -> return $ OP_LOADKX (Reg a)-       3  -> return $ OP_LOADBOOL (Reg a) (b /= 0) (c /= 0)-       4  -> return $ OP_LOADNIL  (Reg a) b-       5  -> return $ OP_GETUPVAL (Reg a) (UpIx b)+       0  -> return $! OP_MOVE (Reg a) (Reg b)+       1  -> return $! OP_LOADK (Reg a) (Kst bx)+       2  -> return $! OP_LOADKX (Reg a)+       3  -> return $! OP_LOADBOOL (Reg a) (b /= 0) (c /= 0)+       4  -> return $! OP_LOADNIL  (Reg a) b+       5  -> return $! OP_GETUPVAL (Reg a) (UpIx b) -       6  -> return $ OP_GETTABUP (Reg a) (UpIx b) (rk c)-       7  -> return $ OP_GETTABLE (Reg a) (Reg b) (rk c)+       6  -> return $! OP_GETTABUP (Reg a) (UpIx b) (rk c)+       7  -> return $! OP_GETTABLE (Reg a) (Reg b) (rk c) -       8  -> return $ OP_SETTABUP (UpIx a) (rk b) (rk c)-       9  -> return $ OP_SETUPVAL (Reg a) (UpIx b)-       10 -> return $ OP_SETTABLE (Reg a) (rk b) (rk c)+       8  -> return $! OP_SETTABUP (UpIx a) (rk b) (rk c)+       9  -> return $! OP_SETUPVAL (Reg a) (UpIx b)+       10 -> return $! OP_SETTABLE (Reg a) (rk b) (rk c) -       11 -> return $ OP_NEWTABLE (Reg a) (fb2int b) (fb2int c)+       11 -> return $! OP_NEWTABLE (Reg a) (fb2int b) (fb2int c) -       12 -> return $ OP_SELF     (Reg a) (Reg b) (rk c)+       12 -> return $! OP_SELF     (Reg a) (Reg b) (rk c) -       13 -> return $ OP_ADD      (Reg a) (rk b) (rk c)-       14 -> return $ OP_SUB      (Reg a) (rk b) (rk c)-       15 -> return $ OP_MUL      (Reg a) (rk b) (rk c)-       16 -> return $ OP_DIV      (Reg a) (rk b) (rk c)-       17 -> return $ OP_MOD      (Reg a) (rk b) (rk c)-       18 -> return $ OP_POW      (Reg a) (rk b) (rk c)-       19 -> return $ OP_UNM      (Reg a) (Reg b)-       20 -> return $ OP_NOT      (Reg a) (Reg b)-       21 -> return $ OP_LEN      (Reg a) (Reg b)+       13 -> return $! OP_ADD      (Reg a) (rk b) (rk c)+       14 -> return $! OP_SUB      (Reg a) (rk b) (rk c)+       15 -> return $! OP_MUL      (Reg a) (rk b) (rk c)+       16 -> return $! OP_DIV      (Reg a) (rk b) (rk c)+       17 -> return $! OP_MOD      (Reg a) (rk b) (rk c)+       18 -> return $! OP_POW      (Reg a) (rk b) (rk c)+       19 -> return $! OP_UNM      (Reg a) (Reg b)+       20 -> return $! OP_NOT      (Reg a) (Reg b)+       21 -> return $! OP_LEN      (Reg a) (Reg b) -       22 -> return $ OP_CONCAT   (Reg a) (Reg b) (Reg c)+       22 -> return $! OP_CONCAT   (Reg a) (Reg b) (Reg c)         23 -> let r | a == 0 = Nothing                    | otherwise = Just (Reg (a-1))-             in return $ OP_JMP r sBx-       24 -> return $ OP_EQ        (a /= 0) (rk b) (rk c)-       25 -> return $ OP_LT        (a /= 0) (rk b) (rk c)-       26 -> return $ OP_LE        (a /= 0) (rk b) (rk c)+             in return $! OP_JMP r sBx+       24 -> return $! OP_EQ        (a /= 0) (rk b) (rk c)+       25 -> return $! OP_LT        (a /= 0) (rk b) (rk c)+       26 -> return $! OP_LE        (a /= 0) (rk b) (rk c) -       27 -> return $ OP_TEST      (Reg a) (c /= 0)-       28 -> return $ OP_TESTSET   (Reg a) (Reg b) (c /= 0)+       27 -> return $! OP_TEST      (Reg a) (c /= 0)+       28 -> return $! OP_TESTSET   (Reg a) (Reg b) (c /= 0) -       29 -> return $ OP_CALL      (Reg a) (mkCount b) (mkCount c)-       30 -> return $ OP_TAILCALL  (Reg a) (mkCount b) (mkCount c)-       31 -> return $ OP_RETURN    (Reg a) (mkCount b)+       29 -> return $! OP_CALL      (Reg a) (mkCount b) (mkCount c)+       30 -> return $! OP_TAILCALL  (Reg a) (mkCount b) (mkCount c)+       31 -> return $! OP_RETURN    (Reg a) (mkCount b) -       32 -> return $ OP_FORLOOP   (Reg a) sBx-       33 -> return $ OP_FORPREP   (Reg a) sBx+       32 -> return $! OP_FORLOOP   (Reg a) sBx+       33 -> return $! OP_FORPREP   (Reg a) sBx -       34 -> return $ OP_TFORCALL  (Reg a) c-       35 -> return $ OP_TFORLOOP  (Reg a) sBx+       34 -> return $! OP_TFORCALL  (Reg a) c+       35 -> return $! OP_TFORLOOP  (Reg a) sBx -       36 -> return $ OP_SETLIST  (Reg a) b c+       36 -> return $! OP_SETLIST  (Reg a) b c -       37 -> return $ OP_CLOSURE  (Reg a) (ProtoIx bx)+       37 -> return $! OP_CLOSURE  (Reg a) (ProtoIx bx) -       38 -> return $ OP_VARARG   (Reg a) (mkCount b)+       38 -> return $! OP_VARARG   (Reg a) (mkCount b) -       39 -> return $ OP_EXTRAARG ax+       39 -> return $! OP_EXTRAARG ax         _  -> fail   $ "Bad instruction: 0x" ++ showHex raw "" @@ -539,70 +539,70 @@               | otherwise            = RK_Reg (Reg x)          sBx = bx - ((1 `shiftL` (size_Bx-1)) - 1)      case op of-       0  -> return $ OP_MOVE (Reg a) (Reg b)-       1  -> return $ OP_LOADK (Reg a) (Kst bx)-       2  -> return $ OP_LOADKX (Reg a)-       3  -> return $ OP_LOADBOOL (Reg a) (b /= 0) (c /= 0)-       4  -> return $ OP_LOADNIL  (Reg a) b-       5  -> return $ OP_GETUPVAL (Reg a) (UpIx b)+       0  -> return $! OP_MOVE (Reg a) (Reg b)+       1  -> return $! OP_LOADK (Reg a) (Kst bx)+       2  -> return $! OP_LOADKX (Reg a)+       3  -> return $! OP_LOADBOOL (Reg a) (b /= 0) (c /= 0)+       4  -> return $! OP_LOADNIL  (Reg a) b+       5  -> return $! OP_GETUPVAL (Reg a) (UpIx b) -       6  -> return $ OP_GETTABUP (Reg a) (UpIx b) (rk c)-       7  -> return $ OP_GETTABLE (Reg a) (Reg b) (rk c)+       6  -> return $! OP_GETTABUP (Reg a) (UpIx b) (rk c)+       7  -> return $! OP_GETTABLE (Reg a) (Reg b) (rk c) -       8  -> return $ OP_SETTABUP (UpIx a) (rk b) (rk c)-       9  -> return $ OP_SETUPVAL (Reg a) (UpIx b)-       10 -> return $ OP_SETTABLE (Reg a) (rk b) (rk c)+       8  -> return $! OP_SETTABUP (UpIx a) (rk b) (rk c)+       9  -> return $! OP_SETUPVAL (Reg a) (UpIx b)+       10 -> return $! OP_SETTABLE (Reg a) (rk b) (rk c) -       11 -> return $ OP_NEWTABLE (Reg a) (fb2int b) (fb2int c)+       11 -> return $! OP_NEWTABLE (Reg a) (fb2int b) (fb2int c) -       12 -> return $ OP_SELF     (Reg a) (Reg b) (rk c)+       12 -> return $! OP_SELF     (Reg a) (Reg b) (rk c) -       13 -> return $ OP_ADD      (Reg a) (rk b) (rk c)-       14 -> return $ OP_SUB      (Reg a) (rk b) (rk c)-       15 -> return $ OP_MUL      (Reg a) (rk b) (rk c)-       16 -> return $ OP_MOD      (Reg a) (rk b) (rk c)-       17 -> return $ OP_POW      (Reg a) (rk b) (rk c)-       18 -> return $ OP_DIV      (Reg a) (rk b) (rk c)-       19 -> return $ OP_IDIV     (Reg a) (rk b) (rk c)-       20 -> return $ OP_BAND     (Reg a) (rk b) (rk c)-       21 -> return $ OP_BOR      (Reg a) (rk b) (rk c)-       22 -> return $ OP_BXOR     (Reg a) (rk b) (rk c)-       23 -> return $ OP_SHL      (Reg a) (rk b) (rk c)-       24 -> return $ OP_SHR      (Reg a) (rk b) (rk c)-       25 -> return $ OP_UNM      (Reg a) (Reg b)-       26 -> return $ OP_BNOT     (Reg a) (Reg b)-       27 -> return $ OP_NOT      (Reg a) (Reg b)-       28 -> return $ OP_LEN      (Reg a) (Reg b)+       13 -> return $! OP_ADD      (Reg a) (rk b) (rk c)+       14 -> return $! OP_SUB      (Reg a) (rk b) (rk c)+       15 -> return $! OP_MUL      (Reg a) (rk b) (rk c)+       16 -> return $! OP_MOD      (Reg a) (rk b) (rk c)+       17 -> return $! OP_POW      (Reg a) (rk b) (rk c)+       18 -> return $! OP_DIV      (Reg a) (rk b) (rk c)+       19 -> return $! OP_IDIV     (Reg a) (rk b) (rk c)+       20 -> return $! OP_BAND     (Reg a) (rk b) (rk c)+       21 -> return $! OP_BOR      (Reg a) (rk b) (rk c)+       22 -> return $! OP_BXOR     (Reg a) (rk b) (rk c)+       23 -> return $! OP_SHL      (Reg a) (rk b) (rk c)+       24 -> return $! OP_SHR      (Reg a) (rk b) (rk c)+       25 -> return $! OP_UNM      (Reg a) (Reg b)+       26 -> return $! OP_BNOT     (Reg a) (Reg b)+       27 -> return $! OP_NOT      (Reg a) (Reg b)+       28 -> return $! OP_LEN      (Reg a) (Reg b) -       29 -> return $ OP_CONCAT   (Reg a) (Reg b) (Reg c)+       29 -> return $! OP_CONCAT   (Reg a) (Reg b) (Reg c)         30 -> let r | a == 0 = Nothing                    | otherwise = Just (Reg (a-1))-             in return $ OP_JMP r sBx-       31 -> return $ OP_EQ        (a /= 0) (rk b) (rk c)-       32 -> return $ OP_LT        (a /= 0) (rk b) (rk c)-       33 -> return $ OP_LE        (a /= 0) (rk b) (rk c)+             in return $! OP_JMP r sBx+       31 -> return $! OP_EQ        (a /= 0) (rk b) (rk c)+       32 -> return $! OP_LT        (a /= 0) (rk b) (rk c)+       33 -> return $! OP_LE        (a /= 0) (rk b) (rk c) -       34 -> return $ OP_TEST      (Reg a) (c /= 0)-       35 -> return $ OP_TESTSET   (Reg a) (Reg b) (c /= 0)+       34 -> return $! OP_TEST      (Reg a) (c /= 0)+       35 -> return $! OP_TESTSET   (Reg a) (Reg b) (c /= 0) -       36 -> return $ OP_CALL      (Reg a) (mkCount b) (mkCount c)-       37 -> return $ OP_TAILCALL  (Reg a) (mkCount b) (mkCount c)-       38 -> return $ OP_RETURN    (Reg a) (mkCount b)+       36 -> return $! OP_CALL      (Reg a) (mkCount b) (mkCount c)+       37 -> return $! OP_TAILCALL  (Reg a) (mkCount b) (mkCount c)+       38 -> return $! OP_RETURN    (Reg a) (mkCount b) -       39 -> return $ OP_FORLOOP   (Reg a) sBx-       40 -> return $ OP_FORPREP   (Reg a) sBx+       39 -> return $! OP_FORLOOP   (Reg a) sBx+       40 -> return $! OP_FORPREP   (Reg a) sBx -       41 -> return $ OP_TFORCALL  (Reg a) c-       42 -> return $ OP_TFORLOOP  (Reg a) sBx+       41 -> return $! OP_TFORCALL  (Reg a) c+       42 -> return $! OP_TFORLOOP  (Reg a) sBx -       43 -> return $ OP_SETLIST  (Reg a) b c+       43 -> return $! OP_SETLIST  (Reg a) b c -       44 -> return $ OP_CLOSURE  (Reg a) (ProtoIx bx)+       44 -> return $! OP_CLOSURE  (Reg a) (ProtoIx bx) -       45 -> return $ OP_VARARG   (Reg a) (mkCount b)+       45 -> return $! OP_VARARG   (Reg a) (mkCount b) -       46 -> return $ OP_EXTRAARG ax+       46 -> return $! OP_EXTRAARG ax         _  -> fail   $ "Bad instruction: 0x" ++ showHex raw ""