vmvalue

Source   Edit  

Conversions between literal ASTs (PNode) and VM memory. This is the boundary between the compiler and the VM: constants, macro arguments and static parameters are stored into VM memory, results of compile-time evaluation are loaded back into ASTs.

Types

ValueConv = object
  mem*: ptr VmMemory
  layouts*: ptr LayoutCache
  conf*: ConfigRef
  nilType*: PType            ## the type of `nil`, for the C backend's sake
everything the conversions need; the VM context owns these. Source   Edit  

Procs

proc loadInt(src: Address; k: MemKind): BiggestInt {....raises: [], tags: [],
    forbids: [].}
loads a scalar and widens it to 64 bits, like the VM's registers do. Source   Edit  
proc loadValue(vc: ValueConv; src: Address; t: PType; info: TLineInfo): PNode {....raises: [
    KeyError, OSError, Exception, ValueError, IOError, ERecoverableError], tags: [
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, RootEffect, WriteIOEffect],
    forbids: [].}
Reads the value of type t at src and turns it into a literal AST. Source   Edit  
proc storeValue(vc: ValueConv; dest: Address; n: PNode; t: PType; inConst: bool) {....raises: [
    KeyError, OSError, Exception, ValueError, IOError, ERecoverableError], tags: [
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, RootEffect, WriteIOEffect],
    forbids: [].}
Source   Edit