Skip to content

Commit

Permalink
IC: much faster caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Dec 4, 2018
1 parent 633832d commit d503368
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions compiler/rodimpl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ proc encodeNode(g: ModuleGraph; fInfo: TLineInfo, n: PNode,
result.add(',')
encodeVInt(int n.info.line, result)
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:
result.add('?')
encodeVInt(n.info.col, result)
Expand Down Expand Up @@ -296,7 +297,8 @@ proc encodeSym(g: ModuleGraph, s: PSym, result: var string) =
result.add(',')
encodeVInt(int s.info.line, result)
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:
result.add('*')
encodeVInt(s.owner.id, result)
Expand Down Expand Up @@ -380,7 +382,7 @@ proc storeType(g: ModuleGraph; t: PType) =
proc transitiveClosure(g: ModuleGraph) =
var i = 0
while true:
if i > 10_000:
if i > 100_000:
doAssert false, "loop never ends!"
if w.sstack.len > 0:
let s = w.sstack.pop()
Expand Down Expand Up @@ -457,9 +459,11 @@ proc decodeLineInfo(g; b; info: var TLineInfo) =
else: info.line = uint16(decodeVInt(b.s, b.pos))
if b.s[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) =
# ')' itself cannot be part of a string literal so that this is correct.
assert b.s[b.pos] == '('
var par = 0
var pos = b.pos+1
Expand Down

0 comments on commit d503368

Please sign in to comment.