add more {.cursor.} to vm (#20796)
This commit is contained in:
parent
1826ff7d84
commit
0ead94c4eb
1 changed files with 13 additions and 13 deletions
|
|
@ -2127,12 +2127,12 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
regs[ra].node.flags.incl nfIsRef
|
regs[ra].node.flags.incl nfIsRef
|
||||||
of opcNccValue:
|
of opcNccValue:
|
||||||
decodeB(rkInt)
|
decodeB(rkInt)
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
regs[ra].intVal = getOrDefault(c.graph.cacheCounters, destKey)
|
regs[ra].intVal = getOrDefault(c.graph.cacheCounters, destKey)
|
||||||
of opcNccInc:
|
of opcNccInc:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
declBC()
|
declBC()
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
let by = regs[rc].intVal
|
let by = regs[rc].intVal
|
||||||
let v = getOrDefault(g.cacheCounters, destKey)
|
let v = getOrDefault(g.cacheCounters, destKey)
|
||||||
g.cacheCounters[destKey] = v+by
|
g.cacheCounters[destKey] = v+by
|
||||||
|
|
@ -2140,7 +2140,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNcsAdd:
|
of opcNcsAdd:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
declBC()
|
declBC()
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
let val = regs[rc].node
|
let val = regs[rc].node
|
||||||
if not contains(g.cacheSeqs, destKey):
|
if not contains(g.cacheSeqs, destKey):
|
||||||
g.cacheSeqs[destKey] = newTree(nkStmtList, val)
|
g.cacheSeqs[destKey] = newTree(nkStmtList, val)
|
||||||
|
|
@ -2150,7 +2150,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNcsIncl:
|
of opcNcsIncl:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
declBC()
|
declBC()
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
let val = regs[rc].node
|
let val = regs[rc].node
|
||||||
if not contains(g.cacheSeqs, destKey):
|
if not contains(g.cacheSeqs, destKey):
|
||||||
g.cacheSeqs[destKey] = newTree(nkStmtList, val)
|
g.cacheSeqs[destKey] = newTree(nkStmtList, val)
|
||||||
|
|
@ -2164,22 +2164,22 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNcsLen:
|
of opcNcsLen:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
decodeB(rkInt)
|
decodeB(rkInt)
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
regs[ra].intVal =
|
regs[ra].intVal =
|
||||||
if contains(g.cacheSeqs, destKey): g.cacheSeqs[destKey].len else: 0
|
if contains(g.cacheSeqs, destKey): g.cacheSeqs[destKey].len else: 0
|
||||||
of opcNcsAt:
|
of opcNcsAt:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
decodeBC(rkNode)
|
decodeBC(rkNode)
|
||||||
let idx = regs[rc].intVal
|
let idx = regs[rc].intVal
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
if contains(g.cacheSeqs, destKey) and idx <% g.cacheSeqs[destKey].len:
|
if contains(g.cacheSeqs, destKey) and idx <% g.cacheSeqs[destKey].len:
|
||||||
regs[ra].node = g.cacheSeqs[destKey][idx.int]
|
regs[ra].node = g.cacheSeqs[destKey][idx.int]
|
||||||
else:
|
else:
|
||||||
stackTrace(c, tos, pc, formatErrorIndexBound(idx, g.cacheSeqs[destKey].len-1))
|
stackTrace(c, tos, pc, formatErrorIndexBound(idx, g.cacheSeqs[destKey].len-1))
|
||||||
of opcNctPut:
|
of opcNctPut:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
let destKey = regs[ra].node.strVal
|
let destKey {.cursor.} = regs[ra].node.strVal
|
||||||
let key = regs[instr.regB].node.strVal
|
let key {.cursor.} = regs[instr.regB].node.strVal
|
||||||
let val = regs[instr.regC].node
|
let val = regs[instr.regC].node
|
||||||
if not contains(g.cacheTables, destKey):
|
if not contains(g.cacheTables, destKey):
|
||||||
g.cacheTables[destKey] = initBTree[string, PNode]()
|
g.cacheTables[destKey] = initBTree[string, PNode]()
|
||||||
|
|
@ -2191,14 +2191,14 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNctLen:
|
of opcNctLen:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
decodeB(rkInt)
|
decodeB(rkInt)
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
regs[ra].intVal =
|
regs[ra].intVal =
|
||||||
if contains(g.cacheTables, destKey): g.cacheTables[destKey].len else: 0
|
if contains(g.cacheTables, destKey): g.cacheTables[destKey].len else: 0
|
||||||
of opcNctGet:
|
of opcNctGet:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
decodeBC(rkNode)
|
decodeBC(rkNode)
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
let key = regs[rc].node.strVal
|
let key {.cursor.} = regs[rc].node.strVal
|
||||||
if contains(g.cacheTables, destKey):
|
if contains(g.cacheTables, destKey):
|
||||||
if contains(g.cacheTables[destKey], key):
|
if contains(g.cacheTables[destKey], key):
|
||||||
regs[ra].node = getOrDefault(g.cacheTables[destKey], key)
|
regs[ra].node = getOrDefault(g.cacheTables[destKey], key)
|
||||||
|
|
@ -2209,7 +2209,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNctHasNext:
|
of opcNctHasNext:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
decodeBC(rkInt)
|
decodeBC(rkInt)
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
regs[ra].intVal =
|
regs[ra].intVal =
|
||||||
if g.cacheTables.contains(destKey):
|
if g.cacheTables.contains(destKey):
|
||||||
ord(btrees.hasNext(g.cacheTables[destKey], regs[rc].intVal.int))
|
ord(btrees.hasNext(g.cacheTables[destKey], regs[rc].intVal.int))
|
||||||
|
|
@ -2218,7 +2218,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNctNext:
|
of opcNctNext:
|
||||||
let g = c.graph
|
let g = c.graph
|
||||||
decodeBC(rkNode)
|
decodeBC(rkNode)
|
||||||
let destKey = regs[rb].node.strVal
|
let destKey {.cursor.} = regs[rb].node.strVal
|
||||||
let index = regs[rc].intVal
|
let index = regs[rc].intVal
|
||||||
if contains(g.cacheTables, destKey):
|
if contains(g.cacheTables, destKey):
|
||||||
let (k, v, nextIndex) = btrees.next(g.cacheTables[destKey], index.int)
|
let (k, v, nextIndex) = btrees.next(g.cacheTables[destKey], index.int)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue