diff options
author | Araq <rumpf_a@web.de> | 2013-08-13 11:21:02 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-08-13 11:21:02 +0200 |
commit | d53f313599111576c9eb290d679d6ed518582530 (patch) | |
tree | f7dda2b11adf60c5df295a13dec96b90c3181a0b /compiler/vm.nim | |
parent | 1633e22aec7a4a932a72469d6728d7f5e25d1805 (diff) | |
download | Nim-d53f313599111576c9eb290d679d6ed518582530.tar.gz |
implemented computed goto support
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index 37f13990f..b02de405e 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -54,8 +54,8 @@ proc bailOut(c: PCtx; tos: PStackFrame) = stackTrace(c, tos, c.exceptionInstr, errUnhandledExceptionX, c.currentExceptionA.sons[2].strVal) -when not defined(nimHasInterpreterLoop): - {.pragma: interpreterLoop.} +when not defined(nimComputedGoto): + {.pragma: computedGoto.} template inc(pc: ptr TInstr, diff = 1) = inc cast[TAddress](pc), TInstr.sizeof * diff @@ -237,7 +237,7 @@ proc execute(c: PCtx, start: int) = var tos: PStackFrame newSeq(regs, c.prc.maxSlots) while true: - {.interpreterLoop.} + {.computedGoto.} let instr = c.code[pc] let ra = instr.regA #echo "PC ", pc, " ", c.code[pc].opcode, " ra ", ra |