diff options
author | Araq <rumpf_a@web.de> | 2014-02-21 17:23:37 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-21 17:23:37 +0100 |
commit | 6e584c42c2d340a31acad85add79b579b3e56f0b (patch) | |
tree | 41edc3eed98efb1697f9a6bfeab181ca6f163867 /compiler/vmdef.nim | |
parent | ab72377ce64cf2b563ea90204925b793082971cb (diff) | |
download | Nim-6e584c42c2d340a31acad85add79b579b3e56f0b.tar.gz |
vm2: new representation of registers
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r-- | compiler/vmdef.nim | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 87159c813..ea7c94856 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 |