Revert "fixes #16790; fixes #19075; put big arrays on the constant seqs; don't inline them in the VM; big performance boost (#21318)"

This reverts commit 7ad8c44e28.
This commit is contained in:
narimiran
2023-09-14 06:03:34 +02:00
parent 5ad4b72ac7
commit 19b3f8c0ea
2 changed files with 2 additions and 24 deletions

View File

@@ -30,7 +30,7 @@
import tables
import
strutils, ast, types, msgs, renderer, vmdef, trees,
strutils, ast, types, msgs, renderer, vmdef,
intsets, magicsys, options, lowerings, lineinfos, transf, astmsgs
from modulegraphs import getBody
@@ -2131,10 +2131,7 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
genLit(c, n, dest)
of skConst:
let constVal = if s.ast != nil: s.ast else: s.typ.n
if dontInlineConstant(n, constVal):
genLit(c, constVal, dest)
else:
gen(c, constVal, dest)
gen(c, constVal, dest)
of skEnumField:
# we never reach this case - as of the time of this comment,
# skEnumField is folded to an int in semfold.nim, but this code

View File

@@ -1,19 +0,0 @@
discard """
timeout: 10
joinable: false
"""
# bug #19075
const size = 50_000
const stuff = block:
var a: array[size, int]
a
const zeugs = block:
var zeugs: array[size, int]
for i in 0..<size:
zeugs[i] = stuff[i]
zeugs
doAssert zeugs[0] == 0