IC: backend: remember produced type information (#17440)
This commit is contained in:
parent
1d19cd660f
commit
d6a16020fe
9 changed files with 93 additions and 42 deletions
|
|
@ -560,23 +560,10 @@ proc addToGenericCache*(c: PContext; s: PSym; inst: PType) =
|
|||
if c.config.symbolFiles != disabledSf:
|
||||
storeTypeInst(c.encoder, c.packedRepr, s, inst)
|
||||
|
||||
proc saveRodFile*(c: PContext) =
|
||||
proc sealRodFile*(c: PContext) =
|
||||
if c.config.symbolFiles != disabledSf:
|
||||
if c.graph.vm != nil:
|
||||
for (m, n) in PCtx(c.graph.vm).vmstateDiff:
|
||||
if m == c.module:
|
||||
addPragmaComputation(c, n)
|
||||
if sfSystemModule in c.module.flags:
|
||||
c.graph.systemModuleComplete = true
|
||||
c.idgen.sealed = true # no further additions are allowed
|
||||
if c.config.symbolFiles != stressTest:
|
||||
# For stress testing we seek to reload the symbols from memory. This
|
||||
# way much of the logic is tested but the test is reproducible as it does
|
||||
# not depend on the hard disk contents!
|
||||
saveRodFile(toRodFile(c.config, AbsoluteFile toFullPath(c.config, FileIndex c.module.position)),
|
||||
c.encoder, c.packedRepr)
|
||||
else:
|
||||
# debug code, but maybe a good idea for production? Could reduce the compiler's
|
||||
# memory consumption considerably at the cost of more loads from disk.
|
||||
simulateCachedModule(c.graph, c.module, c.packedRepr)
|
||||
c.graph.packed[c.module.position].status = loaded
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue