vm

This file implements the new evaluation engine for Nim code. An instruction is 1-3 int32s in memory, it is a register based VM.

Imports

ast, msgs, vmdef, vmgen, nimsets, types, passes, parser, vmdeps, idents, trees, renderer, options, transf, vmmarshal, gorgeimpl, lineinfos, btrees, macrocacheimpl, modulegraphs, sighashes, int128, vmprofiler, semfold, evaltempl, pathutils, sighashes, vmconv

Consts

evalPass = (myOpen, myProcess, myClose, false)
Source Edit

Procs

proc setResult(a: VmArgs; v: BiggestInt) {...}{.raises: [], tags: [].}
Source Edit
proc setResult(a: VmArgs; v: BiggestFloat) {...}{.raises: [], tags: [].}
Source Edit
proc setResult(a: VmArgs; v: bool) {...}{.raises: [], tags: [].}
Source Edit
proc setResult(a: VmArgs; v: string) {...}{.raises: [], tags: [].}
Source Edit
proc setResult(a: VmArgs; n: PNode) {...}{.raises: [], tags: [].}
Source Edit
proc setResult(a: VmArgs; v: AbsoluteDir) {...}{.raises: [], tags: [].}
Source Edit
proc setResult(a: VmArgs; v: seq[string]) {...}{.raises: [], tags: [].}
Source Edit
proc getInt(a: VmArgs; i: Natural): BiggestInt {...}{.raises: [], tags: [].}
Source Edit
proc getBool(a: VmArgs; i: Natural): bool {...}{.raises: [], tags: [].}
Source Edit
proc getFloat(a: VmArgs; i: Natural): BiggestFloat {...}{.raises: [], tags: [].}
Source Edit
proc getString(a: VmArgs; i: Natural): string {...}{.raises: [], tags: [].}
Source Edit
proc getNode(a: VmArgs; i: Natural): PNode {...}{.raises: [], tags: [].}
Source Edit
proc execProc(c: PCtx; sym: PSym; args: openArray[PNode]): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                              ReadEnvEffect, TimeEffect, ReadDirEffect,
                              ExecIOEffect].}
Source Edit
proc evalStmt(c: PCtx; n: PNode) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError, KeyError, OSError, JsonParsingError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ReadDirEffect,
    ExecIOEffect].}
Source Edit
proc evalExpr(c: PCtx; n: PNode): PNode {...}{.raises: [Exception, ValueError,
    IOError, ERecoverableError, KeyError, OSError, JsonParsingError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect,
    ReadDirEffect, ExecIOEffect].}
Source Edit
proc getGlobalValue(c: PCtx; s: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
Source Edit
proc registerAdditionalOps(c: PCtx) {...}{.raises: [OSError, IOError, EOFError,
    ValueError, Exception, ERecoverableError], tags: [ReadEnvEffect,
    WriteEnvEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ExecIOEffect,
    RootEffect, TimeEffect].}
Source Edit
proc setupGlobalCtx(module: PSym; graph: ModuleGraph) {...}{.raises: [OSError,
    IOError, EOFError, ValueError, Exception, ERecoverableError], tags: [
    ReadEnvEffect, WriteEnvEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect,
    ExecIOEffect, RootEffect, TimeEffect].}
Source Edit
proc evalConstExpr(module: PSym; g: ModuleGraph; e: PNode): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
Source Edit
proc evalStaticExpr(module: PSym; g: ModuleGraph; e: PNode; prc: PSym): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
Source Edit
proc evalStaticStmt(module: PSym; g: ModuleGraph; e: PNode; prc: PSym) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
Source Edit
proc setupCompileTimeVar(module: PSym; g: ModuleGraph; n: PNode) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
Source Edit
proc evalMacroCall(module: PSym; g: ModuleGraph; templInstCounter: ref int;
                   n, nOrig: PNode; sym: PSym): PNode {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, OSError, EOFError, KeyError,
    JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                              ReadEnvEffect, WriteEnvEffect, ReadDirEffect,
                              ExecIOEffect, TimeEffect].}
Source Edit

Iterators

iterator genericParamsInMacroCall(macroSym: PSym; call: PNode): (PSym, PNode) {...}{.
    raises: [], tags: [].}
Source Edit

© 2006–2021 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/compiler/vm.html