diff options
author | Araq <rumpf_a@web.de> | 2013-07-29 01:21:32 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-07-29 01:21:32 +0200 |
commit | ef975d277a368ba9d9b85451bb0b054c87d5d782 (patch) | |
tree | ef0061c4e9b4e8a985b8a236dc4c64ed636d3c11 /compiler/vmdef.nim | |
parent | 27b7ecbbff073ad8df0a663960f69a87f10e1e35 (diff) | |
download | Nim-ef975d277a368ba9d9b85451bb0b054c87d5d782.tar.gz |
new vm: further progress
Diffstat (limited to 'compiler/vmdef.nim')
-rw-r--r-- | compiler/vmdef.nim | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/compiler/vmdef.nim b/compiler/vmdef.nim index 93e243bce..449d632b1 100644 --- a/compiler/vmdef.nim +++ b/compiler/vmdef.nim @@ -68,12 +68,33 @@ type opcAddSeqElem, opcRangeChck, + opcNAdd, + opcNAddMultiple, + opcNKind, + opcNIntVal, + opcNFloatVal, + opcNSymbol, + opcNIdent, + opcNGetType, + opcNStrVal, + + opcSlurp, + opcGorge, + opcParseExprToAst, + opcParseStmtToAst, + opcNError, + opcNWarning, + opcNHint, + opcEcho, opcIndCall, # dest = call regStart, n; where regStart = fn, arg1, ... opcIndCallAsgn, # dest = call regStart, n; where regStart = fn, arg1, ... opcRaise, + opcNChild, + opcNSetChild, opcNBindSym, # opcodes for the AST manipulation following + opcCallSite, opcNewStr, opcTJmp, # jump Bx if A != 0 @@ -127,13 +148,15 @@ type currentExceptionA*, currentExceptionB*: PNode exceptionInstr*: int # index of instruction that raised the exception prc*: PProc + module*: PSym + callsite*: PNode TPosition* = distinct int -proc newCtx*(): PCtx = +proc newCtx*(module: PSym): PCtx = PCtx(code: @[], debug: @[], globals: newNode(nkStmtList), constants: newNode(nkStmtList), types: @[], - prc: PProc(blocks: @[])) + prc: PProc(blocks: @[]), module: module) const firstABxInstr* = opcTJmp |