diff options
author | Araq <rumpf_a@web.de> | 2016-10-31 15:34:44 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2016-10-31 15:34:44 +0100 |
commit | 773d17cd14c6f4457245bb3039f644bc3cef64bb (patch) | |
tree | dd38ef41036fe77e97a7a15bf3e1eea9f8515d21 /compiler/vmdef.nim | |
parent | 5494d78e741037f713df446f9135b976073929c7 (diff) | |
download | Nim-773d17cd14c6f4457245bb3039f644bc3cef64bb.tar.gz |
big refactoring: step 1
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r-- | compiler/vmdef.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 83c1dbf43..7fb35e890 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -10,7 +10,7 @@ ## This module contains the type definitions for the new evaluation engine. ## An instruction is 1-3 int32s in memory, it is a register based VM. -import ast, passes, msgs, intsets +import ast, passes, msgs, idents, intsets const byteExcess* = 128 # we use excess-K for immediates @@ -203,16 +203,18 @@ type comesFromHeuristic*: TLineInfo # Heuristic for better macro stack traces callbacks*: seq[tuple[key: string, value: VmCallback]] errorFlag*: string + cache*: IdentCache TPosition* = distinct int PEvalContext* = PCtx -proc newCtx*(module: PSym): PCtx = +proc newCtx*(module: PSym; cache: IdentCache): PCtx = PCtx(code: @[], debug: @[], globals: newNode(nkStmtListExpr), constants: newNode(nkStmtList), types: @[], prc: PProc(blocks: @[]), module: module, loopIterations: MaxLoopIterations, - comesFromHeuristic: unknownLineInfo(), callbacks: @[], errorFlag: "") + comesFromHeuristic: unknownLineInfo(), callbacks: @[], errorFlag: "", + cache: cache) proc refresh*(c: PCtx, module: PSym) = c.module = module |