diff options
author | Camil Staps | 2018-12-25 02:18:27 +0100 |
---|---|---|
committer | Camil Staps | 2018-12-25 02:18:27 +0100 |
commit | bac1fc7844857d1928f4ded2448df3018f4f7f20 (patch) | |
tree | 892fc24bff69bfdadf651472b740f063b6e9d026 /Sjit/Run.icl | |
parent | Don't generate pop 0 (diff) |
Inline +, *, - and /
Diffstat (limited to 'Sjit/Run.icl')
-rw-r--r-- | Sjit/Run.icl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Sjit/Run.icl b/Sjit/Run.icl index e3e623f..ad03e02 100644 --- a/Sjit/Run.icl +++ b/Sjit/Run.icl @@ -33,14 +33,14 @@ where [r] -> r _ -> abort (toString (length stack) +++ " values left on stack\n") - IAddRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a+b:stack] - IMulRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a*b:stack] - ISubRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a-b:stack] - IDivRet -> case stack of - [ret:a:b:stack] -> exec ret [a:a/b:stack] + IAdd -> case stack of + [a:b:stack] -> exec (i+1) [a+b:stack] + IMul -> case stack of + [a:b:stack] -> exec (i+1) [a*b:stack] + ISub -> case stack of + [a:b:stack] -> exec (i+1) [a-b:stack] + IDiv -> case stack of + [a:b:stack] -> exec (i+1) [a/b:stack] get_program :: !CompileState -> Program get_program cs |