From d50336837dfa1a3b81c1b5338b5a9b5d41cf6221 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 4 Dec 2018 22:09:42 +0100 Subject: [PATCH] IC: much faster caching --- compiler/rodimpl.nim | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/rodimpl.nim b/compiler/rodimpl.nim index f0512c0148d4..147e8c3d687b 100644 --- a/compiler/rodimpl.nim +++ b/compiler/rodimpl.nim @@ -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) @@ -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) @@ -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() @@ -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