compiler/vm/vmcompilerserdes

  Source   Edit

Implements the deserialization of VM data into PNode-trees.

Procs

proc deserialize(c: TCtx; handle: LocHandle; asType: PType; info: TLineInfo): PNode {.
    ...raises: [Exception], tags: [RootEffect].}
  Source   Edit
proc deserializeArray(c: TCtx; m: VmMemoryRegion; count: int; stride: int;
                      eTyp: PVmType; f: PType; info: TLineInfo): PNode {.
    ...raises: [Exception], tags: [RootEffect].}
Doesn't set the resulting node's type. f is the formal array element type   Source   Edit
proc deserializeNimNode(c: TCtx; n: PNode; formal: PType; info: TLineInfo): PNode {.
    ...raises: [], tags: [].}
Makes sure n (which represent a NimNode value) is valid and turns it into a proper NimNode literal.   Source   Edit
proc deserializeRef(c: TCtx; slot: HeapSlotHandle; vt: PVmType; f, con: PType;
                    info: TLineInfo): PNode {.
    ...raises: [Exception, ResultErrorRef[system.void]], tags: [RootEffect].}

Produces the construction AST for the ref value represented by slot. If the heap slot is inaccessible or its type not compatible with vt, an error is returned. For the 'nil' slot, a nil literal is returned.

When vt is not noneType, the value is deserialized as if it were of type vt. Otherwise the full value is deserialized.

  Source   Edit