diff options
author | Camil Staps | 2018-12-25 01:54:02 +0100 |
---|---|---|
committer | Camil Staps | 2018-12-25 01:54:02 +0100 |
commit | f8c9564372709e0634c9eb0c208ec9cc31a93de7 (patch) | |
tree | 4092e07b7e341150639491f2b0b4c32a65be2be3 /Sjit/Compile.dcl | |
parent | Better use of monads (diff) |
Add if construct; fib example
Diffstat (limited to 'Sjit/Compile.dcl')
-rw-r--r-- | Sjit/Compile.dcl | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Sjit/Compile.dcl b/Sjit/Compile.dcl index 7cb74e3..fd4b2ee 100644 --- a/Sjit/Compile.dcl +++ b/Sjit/Compile.dcl @@ -12,6 +12,8 @@ from Sjit.Syntax import :: Function | Pop !Int | Call !Int + | Jmp !Int + | JmpTrue !Int | Ret | Halt @@ -20,16 +22,19 @@ from Sjit.Syntax import :: Function | ISubRet | IDivRet + | PlaceHolder !Int !Int // only used during compilation + :: Program :== {!Instr} :: CompileState = - { vars :: !Map String Int - , funs :: !Map String Int - , sp :: !Int - , pc :: !Int - , blocks :: ![!Program!] - , new_block :: ![!Instr!] - , jitst :: !JITState + { vars :: !Map String Int + , funs :: !Map String Int + , sp :: !Int + , pc :: !Int + , blocks :: ![!Program!] + , new_block :: ![!Instr!] + , placeholder :: !Int + , jitst :: !JITState } :: JITState = |