since we have now so many virtual registers, reduce memory consumption for the register allocator (#17985)

This commit is contained in:
Andreas Rumpf 2021-05-10 11:29:19 +02:00 • committed by GitHub
commit a9ae5fe5be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 50 deletions

View file

@ -2106,7 +2106,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
proc execute(c: PCtx, start: int): PNode =
var tos = PStackFrame(prc: nil, comesFrom: 0, next: nil)
newSeq(tos.slots, c.prc.maxSlots)
newSeq(tos.slots, c.prc.regInfo.len)
result = rawExecute(c, start, tos).regToNode
proc execProc*(c: PCtx; sym: PSym; args: openArray[PNode]): PNode =
@ -2203,8 +2203,8 @@ proc evalConstExprAux(module: PSym; idgen: IdGenerator;
assert c.code[start].opcode != opcEof
when debugEchoCode: c.echoCode start
var tos = PStackFrame(prc: prc, comesFrom: 0, next: nil)
newSeq(tos.slots, c.prc.maxSlots)
#for i in 0..<c.prc.maxSlots: tos.slots[i] = newNode(nkEmpty)
newSeq(tos.slots, c.prc.regInfo.len)
#for i in 0..<c.prc.regInfo.len: tos.slots[i] = newNode(nkEmpty)
result = rawExecute(c, start, tos).regToNode
if result.info.col < 0: result.info = n.info
c.mode = oldMode