summary refs log tree commit diff stats
path: root/compiler/vmgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* Markdown code blocks part 6 (#20292)Andrey Makarov2022-08-311-5/+4
|
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * micro implementation of rfc 149 refs https://github.com/nim-lang/RFCs/issues/149 * number/array/seq literals, more statements * try fix number literal alias issue * renew expectedType with if/case/try branch types * fix (nerf) index type handling and float typed int * use typeAllowed * tweaks + const test (tested locally) [skip ci] * fill out more of the checklist * more literals, change @ order, type conversions Not copying the full call tree before the typedesc call check in `semIndirectOp` is also a small performance improvement. * disable self-conversion warning * revert type conversions (maybe separate op later) * deal with CI for now (seems unrelated), try enums * workaround CI different way * proper fix * again * see sizes * lol * overload selection, simplify int literal -> float * range, new @ solution, try use fitNode for nil * use new magic * try fix ranges, new magic, deal with #20193 * add documentation, support templates Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* [vm]fixes #15974 #12551 #19464 #16020 #16780 #16613 #14553 #19909 #18641 ↵flywind2022-06-221-3/+0
| | | | | | | | | | | | | | | (#19902) [backport] * revert #12217 since the root problem seems to have been fixed; fix #15974;fix #12551; fix #19464 * fix #16020; fix #16780 * fix tests and #16613 * fix #14553 * fix #19909; skip skipRegisterAddr * fix #18641
* [cleanup] remove unnecessary procs in vm (#19888)flywind2022-06-131-5/+2
| | | remove unused procs
* fix #19680; check if stderr is static (#19709)flywind2022-04-121-1/+1
|
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* register callback for marshal in VM (#19578)flywind2022-03-081-27/+0
| | | | | | | | | | | | | * register callback for marshal in VM * remove unrelated code * polish * more tests * more tests * add loadVM and toVM
* fixes #19198 [backport:1.6] (#19209)Andreas Rumpf2021-12-041-12/+16
| | | | | * fixes #19198 [backport:1.6] * added a test case
* parseExpr/parseStmt accept filename, fixes #13540 (#19182)hlaaftana2021-11-241-2/+2
|
* correct effect tracking for .borrowed procs [backport] (#18882)Andreas Rumpf2021-09-231-1/+1
| | | | | | | | | | | * correct effect tracking for .borrowed procs [backport] * progress * fix error message in a test * correctly fix it Co-authored-by: narimiran <narimiran@disroot.org>
* allow building 1.4.0 from devel (#18708)Timothee Cour2021-08-181-1/+1
| | | | | * allow building 1.4.0 from devel * changelog
* properly fix #10053 ; `FieldDefect` msg now shows discriminant value + ↵Timothee Cour2021-08-131-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lineinfo, in all backends (c,vm,js) (#11955) * fix #10053 FieldError for vm * fixup * FieldError now also shows runtime value of discriminant * fix field error reporting in vm * also report culprit line info in err msg * fix errors for newruntime 2 * fix for js * fixup * PRTEMP4 * works * works * works perfect * refactor * std/private/repr_impl * suppport --gc:arc * cleanup * refactor * simplify * simplify * simplify * fixup * move out compiler.vmgen.genCustom * fixup * fixup * add tests * revert compiler/debugutils.nim * simplify reprDiscriminant * fixup * lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim * try to fix D20210812T165220 * honor --declaredlocs * control toFileLineCol via --declaredlocs
* fixes #18385 (#18571)Saem Ghani2021-07-251-2/+10
| | | | needs a more permanent fix by better incorporating IC, but fixes nimsuggest highlighting for now.
* make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)Timothee Cour2021-07-201-2/+1
| | | | | | * compiler/vmhooks: add getVar to allow vmops with var params * addFloat vmops with var param * cgen now renders float32 literals in c backend using roundtrip float to string
* ORC: support for custom =trace procs (#18459)Andreas Rumpf2021-07-091-1/+1
| | | | | | | | | | | * ORC: support custom =trace procs (WIP) * Update tests/arc/tcustomtrace.nim Co-authored-by: Clyybber <darkmine956@gmail.com> * =trace is now documented and seems to work * make test green Co-authored-by: Clyybber <darkmine956@gmail.com>
* Renamed `-d:nimCompilerStackraceHints` to `-d:nimCompilerStacktraceHints`. ↵Timothee Cour2021-06-171-2/+2
| | | | (#18283)
* followup #16400; use use -d:nimCompilerStackraceHints in more places (#18282)Timothee Cour2021-06-161-0/+5
|
* since we have now so many virtual registers, reduce memory consumption for ↵Andreas Rumpf2021-05-101-45/+44
| | | | the register allocator (#17985)
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-211-1/+1
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-6/+6
| | | | cstring, not cString (#17744)
* IC: yet another embarrassing omission (#17743)Andreas Rumpf2021-04-171-8/+6
| | | | | * IC: yet another embarrassing omission * VM: fewer hacks that kept IC from working
* implement RFCs/294 ; disallow enum <=> enum conversion (#16351)Timothee Cour2021-04-031-2/+2
| | | | | | | | | | | * fix https://github.com/nim-lang/RFCs/issues/294 ; disallow enum <=> enum conversion * fix the runnableExamples that was the instigator of this RFC * legacy -d:nimLegacyConvEnumEnum * use -d:nimLegacyConvEnumEnum in important_package nimgame2 * add test for enum cast * improve changelog * add changelog: Changes affecting backward compatibility * cleanup changelog * fix changelog
* fix #14585, fix #17589: access to static param now works (#17590)Timothee Cour2021-03-311-1/+1
|
* fix #12282 distinct now does not create erroneous copy in VM (#17594)Timothee Cour2021-03-311-2/+12
|
* Fix #17199 (#17348)Clyybber2021-03-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | * don't zero out in a move in the VM * Add testcases for #17199 * Update tests/arc/tarcmisc.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update tests/vm/tissues.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Fix test failures * Fix test * Fix tests Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* semLambda removed, semProcAux reworked (#17379)Saem Ghani2021-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * simplified proc-like name ident to symbol code * wip - reworking generic param sem * wip - closer to removing nkEmpty generic params * it's hacky but tests pass * slowly tweaking semProcAux to take on semLambda * fix pragma superset check proto vs current * Set the symbol owner earlier * partial progress reworking proto found bug where default values between forward and impl lead to overload resolution issues. * simplified pragma handling and callConv checks Co-authored-by: Clyybber <Clyybber@users.noreply.github.com> * partially working * cgexprs issue * It works! * comment clean-up * clean-up asserts, comments, and other bits * add isGenericParams, inline isGeneric queries * seeing if this is sufficiently consistent * can use this approach or continue it in a further PR * commentary about nullary generics and clean-ups * fixed a mistake in PNode isGenericRoutine * Some small cleanups * Small cleanup * for func lambdas ensure we use lambda pragmas * add some basic compileTime func tests * [ci skip] remove comments Co-authored-by: Clyybber <Clyybber@users.noreply.github.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
* fixes #11225; generic sandwich problems; [backport:1.2] (#17255)Andreas Rumpf2021-03-091-1/+2
| | | | | * fixes #11225; generic sandwich problems; [backport:1.2] * progress * delegating these symbols must be done via 'bind'
* fix #17264 [backport:1.4] (#17266)flywind2021-03-051-1/+3
| | | | | * fix #17264 * fix vm * fix js and add tests
* fixed dot operator recursive loop & macro suggest (#16922)Saem Ghani2021-02-151-1/+4
| | | | | | | | | | | | | | | | | | * basic stability improvements; refs nimsuggest * fixed dot operator recursive loop & macro suggest * hacky fix for run away dot operator sem check Committing this mostly to make the issue more clear. Perhaps get better feedback. * semExprWithType seems like a better place to check * fixed error messages const case expressions * Clean-up test * stopped the dot operator madness No longer get infinite recursion when seming broken code with a dot operator macro like in jsffi. Co-authored-by: Araq <rumpf_a@web.de>
* fix #16555, fixes #16405: len, high honors '\0' for cstring in vm (#16610)Timothee Cour2021-01-111-5/+7
|
* IC: next steps (#16550)Andreas Rumpf2021-01-071-5/+8
| | | | | | | | | | | | | | | | | | * cleanups * ast.nim: cleanups * IC: no more sym.tab field, stored externally in the module graph * nimble compiles again * rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly * rodfiles: added compilerproc and export sections * rodfiles: added all the missing sections * rodfiles: track the missing information * IC: architecture for lazy loading of proc bodies * make tests green again * completed the lazy loading of proc bodies * symbol lookup integration, part 1 * symbol lookup integration, part 2 * symbol lookup integration, part 3 * make tcompilerapi work again * rodfiles: fixed config change handling
* move asciitables to std/private/ (#16498)flywind2020-12-291-1/+1
| | | | | * move asciitables * minor
* fix #16469 vm float constants: do not conflate -0.0 and 0.0 (#16470)Timothee Cour2020-12-271-1/+6
| | | | | * fix #16469 vm float constants: do not conflate -0.0 and 0.0 * fix test for 32bit
* [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)Timothee Cour2020-12-221-10/+2
| | | | | * fix #16428 vmops now works for generic procs * remove duplication
* [docs minor]space for code-block (#16266)flywind2020-12-061-1/+1
| | | | | | | | | * [docs minor]space for code-block * correct more errors * to runnableExamples * add newline
* fixes #15939, fixes #15464, fixes #16169, fixes #16226 VM now supports ↵Timothee Cour2020-12-031-4/+6
| | | | | | | | | `addr(mystring[ind])` (index + index assignment) (#15987) * fix #15939, fix #15464 VM now supports `addr(mystring[ind])` (index + index assignment), var char return etc * cleanups * cstring tests * add test for bug #15464 * improve test coverage
* combine PR#16009 and PR#16012 (#16024)flywind2020-11-181-0/+5
| | | | | | | | * fix #15623 * add testcase for #15623 * add testcase * combine #16009 * support casting nil to NilableTypes in VM
* Revert "follow #16009 VM supports cast nil to ptr (#16012)"Andrey R (cooldome)2020-11-171-3/+0
| | | | This reverts commit fec19c980e36e62747eb119f0740cb785e858ac3.
* follow #16009 VM supports cast nil to ptr (#16012)flywind2020-11-171-0/+3
| | | | | * follow #16009 VM supports cast nil to ptr * more testcase
* fix #15463 (#15831)flywind2020-11-051-1/+1
|
* Closure iterators are not supported by VM (#15818)flywind2020-11-021-0/+2
|
* fixes #15717flywind2020-11-021-0/+2
|
* fix #15704 #15597 wrong VM register was freed (#15705)Timothee Cour2020-10-261-2/+4
| | | | | | | | | | | | | * fix #15704 #15597 wrong VM register was freed * same treatment for nkCheckedFieldExpr * note concerning HighRegisterPressure * bump NimPatch * Update lib/system.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-3/+3
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* [minor] nimVMDebug: fix codeListing formatting for jump-to-file to work (#15711)Timothee Cour2020-10-251-1/+1
|
* fix #15662 (#15678)cooldome2020-10-231-17/+15
| | | | | | | * fix #15662 * alternative fix * fix spacing
* const view types; fixes some cases from ↵Andreas Rumpf2020-10-051-1/+1
| | | | https://github.com/nim-lang/Nim/issues/15428 (#15488)
* fix warnings for deprecated `low` and `high` (#15291)Miran2020-09-111-1/+1
|
* Big compiler Cleanup (#14777)Clyybber2020-08-281-17/+4
|
* 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011)Andreas Rumpf2020-07-201-1/+1
|