diff options
author | Araq <rumpf_a@web.de> | 2014-02-25 01:21:00 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-25 01:21:00 +0100 |
commit | 20131c32af45905fcbfd64ce1fbdfa8e83ecee2d (patch) | |
tree | 24f2d9c91387ce4fabf400089440521c9b1fb034 /compiler/vmdef.nim | |
parent | 10768904eb65da1899d0d48cc1a2f3547af3bef0 (diff) | |
parent | 263cabd1c27977aa32c849ffb334984e8d476b97 (diff) | |
download | Nim-20131c32af45905fcbfd64ce1fbdfa8e83ecee2d.tar.gz |
Merge branch 'vm2_2' into devel
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r-- | compiler/vmdef.nim | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 87159c813..72689c879 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -8,7 +8,7 @@ # ## This module contains the type definitions for the new evaluation engine. -## An instruction is 1-2 int32s in memory, it is a register based VM. +## An instruction is 1-3 int32s in memory, it is a register based VM. import ast, passes, msgs, intsets @@ -32,17 +32,17 @@ type opcAsgnFloat, opcAsgnRef, opcAsgnComplex, + opcRegToNode, + opcNodeToReg, opcLdArr, # a = b[c] - opcLdArrRef, opcWrArr, # a[b] = c - opcWrArrRef, opcLdObj, # a = b.c - opcLdObjRef, opcWrObj, # a.b = c - opcWrObjRef, - opcAddr, - opcDeref, + opcAddrReg, + opcAddrNode, + opcLdDeref, + opcWrDeref, opcWrStrIdx, opcLdStrIdx, # a = b[c] @@ -117,15 +117,13 @@ type opcNew, opcNewSeq, opcLdNull, # dest = nullvalue(types[Bx]) + opcLdNullReg, opcLdConst, # dest = constants[Bx] opcAsgnConst, # dest = copy(constants[Bx]) opcLdGlobal, # dest = globals[Bx] + opcLdImmInt, # dest = immediate value opcNBindSym, - opcWrGlobal, - opcWrGlobalRef, - opcGlobalAlias, # load an alias to a global into a register - opcGlobalOnce, # used to introduce an assignment to a global once opcSetType, # dest.typ = types[Bx] opcTypeTrait @@ -165,8 +163,6 @@ type blocks*: seq[TBlock] # blocks; temp data structure slots*: array[TRegister, tuple[inUse: bool, kind: TSlotKind]] maxSlots*: int - globals*: array[TRegister, int] # hack: to support passing globals byref - # we map a slot persistently to a global PCtx* = ref TCtx TCtx* = object of passes.TPassContext # code gen context @@ -183,6 +179,7 @@ type callsite*: PNode mode*: TEvalMode features*: TSandboxFlags + traceActive*: bool TPosition* = distinct int |