IC: much faster caching
This commit is contained in:
parent
633832d0de
commit
d50336837d
1 changed files with 8 additions and 4 deletions
|
|
@ -113,7 +113,8 @@ proc encodeNode(g: ModuleGraph; fInfo: TLineInfo, n: PNode,
|
||||||
result.add(',')
|
result.add(',')
|
||||||
encodeVInt(int n.info.line, result)
|
encodeVInt(int n.info.line, result)
|
||||||
result.add(',')
|
result.add(',')
|
||||||
encodeVInt(toDbFileId(g.incr, g.config, n.info.fileIndex), result)
|
#encodeVInt(toDbFileId(g.incr, g.config, n.info.fileIndex), result)
|
||||||
|
encodeVInt(n.info.fileIndex.int, result)
|
||||||
elif fInfo.line != n.info.line:
|
elif fInfo.line != n.info.line:
|
||||||
result.add('?')
|
result.add('?')
|
||||||
encodeVInt(n.info.col, result)
|
encodeVInt(n.info.col, result)
|
||||||
|
|
@ -296,7 +297,8 @@ proc encodeSym(g: ModuleGraph, s: PSym, result: var string) =
|
||||||
result.add(',')
|
result.add(',')
|
||||||
encodeVInt(int s.info.line, result)
|
encodeVInt(int s.info.line, result)
|
||||||
result.add(',')
|
result.add(',')
|
||||||
encodeVInt(toDbFileId(g.incr, g.config, s.info.fileIndex), result)
|
#encodeVInt(toDbFileId(g.incr, g.config, s.info.fileIndex), result)
|
||||||
|
encodeVInt(s.info.fileIndex.int, result)
|
||||||
if s.owner != nil:
|
if s.owner != nil:
|
||||||
result.add('*')
|
result.add('*')
|
||||||
encodeVInt(s.owner.id, result)
|
encodeVInt(s.owner.id, result)
|
||||||
|
|
@ -380,7 +382,7 @@ proc storeType(g: ModuleGraph; t: PType) =
|
||||||
proc transitiveClosure(g: ModuleGraph) =
|
proc transitiveClosure(g: ModuleGraph) =
|
||||||
var i = 0
|
var i = 0
|
||||||
while true:
|
while true:
|
||||||
if i > 10_000:
|
if i > 100_000:
|
||||||
doAssert false, "loop never ends!"
|
doAssert false, "loop never ends!"
|
||||||
if w.sstack.len > 0:
|
if w.sstack.len > 0:
|
||||||
let s = w.sstack.pop()
|
let s = w.sstack.pop()
|
||||||
|
|
@ -457,9 +459,11 @@ proc decodeLineInfo(g; b; info: var TLineInfo) =
|
||||||
else: info.line = uint16(decodeVInt(b.s, b.pos))
|
else: info.line = uint16(decodeVInt(b.s, b.pos))
|
||||||
if b.s[b.pos] == ',':
|
if b.s[b.pos] == ',':
|
||||||
inc(b.pos)
|
inc(b.pos)
|
||||||
info.fileIndex = fromDbFileId(g.incr, g.config, decodeVInt(b.s, b.pos))
|
#info.fileIndex = fromDbFileId(g.incr, g.config, decodeVInt(b.s, b.pos))
|
||||||
|
info.fileIndex = FileIndex decodeVInt(b.s, b.pos)
|
||||||
|
|
||||||
proc skipNode(b) =
|
proc skipNode(b) =
|
||||||
|
# ')' itself cannot be part of a string literal so that this is correct.
|
||||||
assert b.s[b.pos] == '('
|
assert b.s[b.pos] == '('
|
||||||
var par = 0
|
var par = 0
|
||||||
var pos = b.pos+1
|
var pos = b.pos+1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue