summary refs log tree commit diff stats
path: root/compiler/vm.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #19198 [backport:1.6] (#19209)Andreas Rumpf2021-12-041-2/+4
| | | | | * fixes #19198 [backport:1.6] * added a test case
* parseExpr/parseStmt accept filename, fixes #13540 (#19182)hlaaftana2021-11-241-5/+4
|
* Fix VM's sametype impl to work for generics/typedescs (#19073)Jason Beetham2021-11-021-1/+2
| | | | | | | * Fix vm's sametype implementation to properly handle generics and typedescs * actually fixed sametype + have test * added comments and removed unsafe code
* Added setGlobalValue to VM api (#19007)Jason Beetham2021-10-171-0/+5
|
* properly fix #10053 ; `FieldDefect` msg now shows discriminant value + ↵Timothee Cour2021-08-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* refs #16613: check opcWrDeref for nil (#18613)Timothee Cour2021-07-301-5/+4
|
* enable VM tracing in user code via `{.define(nimVmTrace).}` (#18244)Timothee Cour2021-06-241-2/+5
| | | | | | | * enable VM tracing in user code via `{.define(nimVmTrace).}` * add vmutils.vmTrace * add vmTrace
* fix #18310 system.== in vm for NimNode (#18313)Timothee Cour2021-06-211-5/+6
| | | | | | | * fix #18310 == in vm * fixup * fixup
* ORC: progress (#18000)Andreas Rumpf2021-05-121-1/+1
| | | | | | | | | * ORC: progress * ORC: bugfix; don't follow acyclic data even if only at runtime the subtype is marked as acyclic * progress * minor style changes
* since we have now so many virtual registers, reduce memory consumption for ↵Andreas Rumpf2021-05-101-3/+3
| | | | the register allocator (#17985)
* fix #17836 (typed macro isNil for proc params) (#17841)Saem Ghani2021-04-251-2/+2
| | | thanks @alaviss for the test
* unit separator (#17730)Andreas Rumpf2021-04-201-5/+5
| | | | | * use the ASCII Unit Separator so that error messages can be handled precisely by the tooling * updated testament
* Introduce localErrorNode (#17785)Clyybber2021-04-191-4/+4
|
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-1/+1
| | | | cstring, not cString (#17744)
* fix #17572 (#17586)Timothee Cour2021-03-311-1/+2
|
* unify tuple expressions (#13793)Arne Döring2021-03-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * unify tuple expressions * fix test * fix test * apply feedback * Handle empty tuples * Fix rendering named unary tuple * Protect static NimNode against stripping * Slightly less hacky * Revert "Slightly less hacky" This reverts commit 170c5aec0addc029f637afbc948700ca006b7942. * Slightly less hacky * Cleanup * Fix test * Fix another test * Add condsym * Rebase fallout * changelog: Move from compiler changes to language changes * Add stricter tests * Add empty tuple example to doc/astspec * Fix test Co-authored-by: Clyybber <darkmine956@gmail.com>
* Typo in vm.nimClyybber2021-03-291-1/+1
|
* arc now bootstraps (#17342)Clyybber2021-03-121-8/+14
| | | ./koch boot --gc:arc works :D
* fix #16384 and #17144 (#17126) [backport]flywind2021-03-031-1/+2
|
* Fixes #17039 - ldObj checks node/nodeAddr access (#17123)Saem Ghani2021-02-231-1/+1
| | | | | | Checked field expressions, such as an object variant field access results in occasionally broken address analysis crashing the VM. This guard added here mimics guarded access in ldObjAddr as well. This is to prevent a crash, while a fix is devised.
* fixed dot operator recursive loop & macro suggest (#16922)Saem Ghani2021-02-151-2/+2
| | | | | | | | | | | | | | | | | | * 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>
* remove conditionals on nimHasUserErrors, nimNoNilSeqs2, nimNoNilSeqs (#16861)Timothee Cour2021-01-291-4/+0
| | | | | | | | | * cleanup docs for type(nil) | type(nil); simplify nimHasUserErrors * simplify nimNoNilSeqs2 * simplify nimNoNilSeqs * fixup
* fix #13517 (#16681)flywind2021-01-111-3/+3
|
* fix #16555, fixes #16405: len, high honors '\0' for cstring in vm (#16610)Timothee Cour2021-01-111-0/+4
|
* IC: next steps (#16550)Andreas Rumpf2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | * 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
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-3/+3
| | | | | | | | | | | | | | | | | | | * reworked ID handling * the packed AST now has its own ID mechanism * basic serialization code works * extract rodfiles to its own module * rodfiles: store and compare configs * rodfiles: store dependencies * store config at the end * precise dependency tracking * dependency tracking for rodfiles * completed loading of PSym, PType, etc * removed dead code * bugfix: do not realloc seqs when taking addr into an element * make IC opt-in for now * makes tcompilerapi green again * final cleanups Co-authored-by: Andy Davidoff <github@andy.disruptek.com>
* fix `hintProcessing` dots interference with `static:echo` and `hintCC`; add ↵Timothee Cour2020-12-301-3/+3
| | | | | | | | | | tests for `nim secret`, add tests for hintProcessing, misc other bug fixes (#16495) * fix dots interfering with static:echo * add tests * fix hintProcessing dots for hintCC * improve trunner tests * fix bug: readLineFromStdin now writes prompt to stdout, consistent with linenoise and rdstdin * disable a failing test for windows
* fixes #15939, fixes #15464, fixes #16169, fixes #16226 VM now supports ↵Timothee Cour2020-12-031-1/+20
| | | | | | | | | `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
* fix #14339, #13511, #14420: fixes limited VM support for addr (#16002)Timothee Cour2020-11-251-2/+5
| | | | | | | | | | | * fix #14339: fixes limited VM support for addr * strengthen test * reference bug #16003 * also fixes #13511 * also fixes #14420
* Correct all eggs (#15906)Miran2020-11-101-2/+2
| | | | * "eg" is a misspelled "egg", "e.g." is "exempli gratia" * Also, "ie" is "i.e.".
* new: `nim -e:cmd` to run a command directly; also fixes #15731 (#15687)Timothee Cour2020-11-091-0/+3
| | | | | | | | | | | | | | | * new: `nim -i cmd` * rename -i to -e (for eval); consistent with majority of other programing languages * `nim e -e:cmd` now works; bugfix: `echo cmd | nim e -` now works * honor --betterRun * address comments * --eval alias for -e (replaces undocumented --eval which was a noop) * --eval now defaults to e (nimscript) instead of r * address comment: remove -e, only keep --eval * address comment * fixup * Update compiler/nimconf.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* [backport] fix #15595 procvar `==` works in VM (#15724)Timothee Cour2020-10-261-2/+4
|
* Fixed iteration limit hit from execproc (#15723) [backport:1.2] [backport:1.4]Jason Beetham2020-10-261-0/+1
| | | When calling procs from Nim in Nimscript you could hit the VM iteration limit even though the code is functioning properly. This resolves that by making the iteration limit reset eachtime you call a proc.
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-34/+34
| | | | | | | | | | | | | | | | | * 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)
* Fix forward declaration issues in template/macro context (#15091)Clyybber2020-07-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | * Fix forward declaration issues in template/macro context * Correct forward declaration resolving for overloads * Remove old dead code * WIP consistent gensym ids * Minimize diff * Remove obsoleted hack * Add templInstCounter to give unique IDs to template instantiations * Remove obsoleted code * Eh, init in myOpen, not myProcess... * Remove optNimV019 * Add testcase for #13484
* VM profiler (#14833)Ico Doornekamp2020-07-091-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | * Crude VM profiler * Added --profileVM flag, refactoring * fixed FileLine hash * Use TLineInfo instead of own FileLine, updated formatting * Refactoring, moved PStackFrame to vmdefs for cleaner data structure * Moved vmprofiler to separate file * Simplified TLineInfo hash, use toFileLineCol for output * Hash * Moved profile data into Config, dump only once at end of run * Changed profile output header to show '#instr' instead of 'count' * Do not accumulate instrcount for non-top frames Co-authored-by: Ico Doornekamp <git@zevv.nl>
* Deprecated laxStrings for mutating the internal zero terminator on strings ↵Juan Carlos2020-06-231-2/+0
| | | | | and its Deprecated code cleaned out (#14766) Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* `hintMsgOrigin` now works in VM code (#14678)Timothee Cour2020-06-161-10/+8
| | | | | * `hintMsgOrigin` now works in VM code * remove a simplification for now
* fixes #14340Araq2020-05-141-4/+4
|
* Make ./koch temp --gc:arc work (#14186)Clyybber2020-05-011-3/+6
|
* fix https://github.com/timotheecour/Nim/issues/88 (#13865) [backport:1.2]Timothee Cour2020-04-061-30/+23
|
* Fix vm.nim for --gc:arc (#13741)Clyybber2020-03-261-14/+2
| | | | | | | | | | | | | * koch boot --gc:arc now passes the nim stage ... but generates invalid C code * Move it closer to where its used * Try something else * Poor mans var * Use UncheckedArray instead
* fixes #13744 (#13749)cooldome2020-03-251-0/+6
| | | | | | | * fixes #13744 * improve style Co-authored-by: cooldome <ariabushenko@gmail.ru>
* Remove dead magics (#13551)Arne Döring2020-03-031-5/+0
|
* fix #13479 (#13503)Arne Döring2020-02-261-2/+2
|
* make goto based exceptions available for 'nim cpp' (#13244)Andreas Rumpf2020-01-251-1/+1
| | | | | * make goto based exceptions available for 'nim cpp' * optimize seq.add to be comparable to C++'s emplace_back
* VM: allow overriding MaxLoopIterations without rebuilding nim (#13233)Timothee Cour2020-01-231-4/+3
|
* make case-object transitions explicit, make unknownLineInfo a const, replace ↵Jasper Jenkins2020-01-171-51/+26
| | | | a few magic numbers with consts (#13170)
* VM: support importc var, ptr/pointer types, cast int <=> ptr/pointer (#12877)Timothee Cour2020-01-051-19/+153
| | | | | | | | | | | | | | * VM: allow certain hardcoded special var variables at CT * VM: allow all importc var, cast[int](ptr) * fix tests tests/vm/tstaticprintseq.nim, tests/cpp/t8241.nim * VM: == works for ptr/pointer nodes * bugfix: ==, cast now also works for pointer, not just ptr * VM supports cast PtrLikeKinds <=> PtrLikeKinds / int * improve cname handling * fixup + bug fix * VM: support cast from ref to int * address comment: opcLdGlobalDeref => opcLdGlobalDerefFFI * defensive check against typ == nil
* VM: allow ptr setting ptr fields (#12825)Timothee Cour2019-12-061-1/+5
|