IC: final implementation steps (#16801)

* removed dead code
* we need even more laziness for the generic caches
* make it bootstrap on older Nims
* wrote more deserialization code
* IC: replay required methods information
This commit is contained in:
Andreas Rumpf 2021-01-25 20:52:26 +01:00 • committed by GitHub
commit 25745ad195
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 259 additions and 105 deletions

View file

@ -31,6 +31,11 @@ type
bodiesSection
symsSection
typesSection
typeInstCacheSection
procInstCacheSection
attachedOpsSection
methodsPerTypeSection
enumToStringProcsSection
aliveSymsSection # beware, this is stored in a `.alivesyms` file.
RodFileError* = enum
@ -73,6 +78,12 @@ proc storePrim*[T](f: var RodFile; x: T) =
elif T is tuple:
for y in fields(x):
storePrim(f, y)
elif T is object:
for y in fields(x):
when y is seq:
storeSeq(f, y)
else:
storePrim(f, y)
else:
{.error: "unsupported type for 'storePrim'".}
@ -107,6 +118,12 @@ proc loadPrim*[T](f: var RodFile; x: var T) =
elif T is tuple:
for y in fields(x):
loadPrim(f, y)
elif T is object:
for y in fields(x):
when y is seq:
loadSeq(f, y)
else:
loadPrim(f, y)
else:
{.error: "unsupported type for 'loadPrim'".}