From f8c9564372709e0634c9eb0c208ec9cc31a93de7 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 25 Dec 2018 01:54:02 +0100 Subject: Add if construct; fib example --- Sjit/Compile.dcl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'Sjit/Compile.dcl') 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 = -- cgit v1.2.3