fixes #7827, bindSym enhancement (#8499)

* bindSym power up, working prototype

* update bindSym doc

* add bindSym test

* fix some typo

* fix bindSym doc

* get rid of specialops field from vm

* add experimental: dynamicBindSym
This commit is contained in:
andri lim 2018-08-02 17:56:44 +07:00 • committed by Andreas Rumpf
commit 78c0ac5407
9 changed files with 183 additions and 13 deletions

View file

@ -136,7 +136,7 @@ type
opcLdGlobalAddr, # dest = addr(globals[Bx])
opcLdImmInt, # dest = immediate value
opcNBindSym,
opcNBindSym, opcNDynBindSym,
opcSetType, # dest.typ = types[Bx]
opcTypeTrait,
opcMarshalLoad, opcMarshalStore,
@ -229,7 +229,8 @@ proc refresh*(c: PCtx, module: PSym) =
c.prc = PProc(blocks: @[])
c.loopIterations = MaxLoopIterations
proc registerCallback*(c: PCtx; name: string; callback: VmCallback) =
proc registerCallback*(c: PCtx; name: string; callback: VmCallback): int {.discardable.} =
result = c.callbacks.len
c.callbacks.add((name, callback))
const