This file implements the new evaluation engine for Nim code. An instruction is 1-3 int32s in memory, it is a register based VM.
Procs
proc evalConstExpr(module: PSym; idgen: IdGenerator; g: ModuleGraph; e: PNode): PNode {....raises: [ Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc evalExpr(c: PCtx; n: PNode): PNode {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc evalMacroCall(module: PSym; idgen: IdGenerator; g: ModuleGraph; templInstCounter: ref int; n, nOrig: PNode; sym: PSym): PNode {....raises: [ Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc evalStaticExpr(module: PSym; idgen: IdGenerator; g: ModuleGraph; e: PNode; prc: PSym): PNode {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc evalStaticStmt(module: PSym; idgen: IdGenerator; g: ModuleGraph; e: PNode; prc: PSym) {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc evalStmt(c: PCtx; n: PNode) {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc execProc(c: PCtx; sym: PSym; args: openArray[PNode]): PNode {....raises: [ Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc getGlobalValue(c: PCtx; s: PSym): PNode {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
- Source Edit
proc getNodeAddr(a: VmArgs; i: Natural): PNode {....raises: [], tags: [].}
- Source Edit
proc registerAdditionalOps(c: PCtx) {....raises: [], tags: [].}
- Source Edit
proc setGlobalValue(c: PCtx; s: PSym; val: PNode) {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
- Does not do type checking so ensure the val matches the s.typ Source Edit
proc setResult(a: VmArgs; v: AbsoluteDir) {....raises: [], tags: [].}
- Source Edit
proc setupCompileTimeVar(module: PSym; idgen: IdGenerator; g: ModuleGraph; n: PNode) {....raises: [Exception, ValueError, KeyError, OSError, IOError, ERecoverableError, JsonParsingError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ExecIOEffect].}
- Source Edit
proc setupGlobalCtx(module: PSym; graph: ModuleGraph; idgen: IdGenerator) {. ...raises: [], tags: [].}
- Source Edit