From 25745ad195580772d4689a7c98f9b3f77f06cdd1 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 25 Jan 2021 20:52:26 +0100 Subject: [PATCH] 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 --- compiler/ccgexprs.nim | 1 - compiler/cgmeth.nim | 4 +- compiler/ic/packed_ast.nim | 6 +- compiler/ic/replayer.nim | 46 ++++++++- compiler/ic/rodfiles.nim | 17 ++++ compiler/ic/to_packed_ast.nim | 81 +++++++++++---- compiler/modulegraphs.nim | 182 +++++++++++++++++++++------------- compiler/modules.nim | 1 + compiler/semdata.nim | 12 +++ compiler/seminst.nim | 2 +- compiler/semstmts.nim | 4 +- compiler/semtypinst.nim | 8 +- 12 files changed, 259 insertions(+), 105 deletions(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index f9a637815fdd..98e65b262c0f 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2236,7 +2236,6 @@ proc genSlice(p: BProc; e: PNode; d: var TLoc) = "'toOpenArray' is only valid within a call expression") proc genEnumToStr(p: BProc, e: PNode, d: var TLoc) = - const ToStringProcSlot = -4 let t = e[1].typ.skipTypes(abstractInst+{tyRange}) let toStrProc = getToStringProc(p.module.g.graph, t) # XXX need to modify this logic for IC. diff --git a/compiler/cgmeth.nim b/compiler/cgmeth.nim index b1446582890f..484bc9d97600 100644 --- a/compiler/cgmeth.nim +++ b/compiler/cgmeth.nim @@ -160,7 +160,7 @@ proc fixupDispatcher(meth, disp: PSym; conf: ConfigRef) = if disp.typ.lockLevel < meth.typ.lockLevel: disp.typ.lockLevel = meth.typ.lockLevel -proc methodDef*(g: ModuleGraph; idgen: IdGenerator; s: PSym, fromCache: bool) = +proc methodDef*(g: ModuleGraph; idgen: IdGenerator; s: PSym) = var witness: PSym for i in 0..