From 19b3f8c0eaec983f55956749e790c63c7436a5b2 Mon Sep 17 00:00:00 2001 From: narimiran Date: Thu, 14 Sep 2023 06:03:34 +0200 Subject: [PATCH] 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 7ad8c44e286847a7443a4172bc454ae84f315b6d. --- compiler/vmgen.nim | 7 ++----- tests/vm/t19075.nim | 19 ------------------- 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 tests/vm/t19075.nim diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index ac6aa90a84..4d68927298 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -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 diff --git a/tests/vm/t19075.nim b/tests/vm/t19075.nim deleted file mode 100644 index 89ca9cb197..0000000000 --- a/tests/vm/t19075.nim +++ /dev/null @@ -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..