summary refs log tree commit diff stats
path: root/compiler/vm.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* fixes #11727 [backport]Araq2019-11-281-2/+4
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-68/+68
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* VM: improvements for var T/addr (#12667); fixes #12489Andreas Rumpf2019-11-281-0/+27
|
* fixes #12670 [backport] (#12693)Andreas Rumpf2019-11-201-1/+2
|
* ARC: solves phase ordering problems (#12654)Andreas Rumpf2019-11-141-10/+12
|
* backtick and export marker handling in `eqIdent` (#12574)Arne Döring2019-11-071-5/+16
|
* fixes #12244 [backport]Araq2019-10-101-1/+0
|
* VM: no special casing for big endian machines; refs #9690 [backport] (#12364)Andreas Rumpf2019-10-061-6/+2
|
* fixes #12281 [backport]Andreas Rumpf2019-09-301-5/+6
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-4/+4
|
* add nodeId proc to macros (#11456)Arne Döring2019-09-181-0/+6
| | | | | | | | * add nodeId proc to macros * add doc comment. * fix typo
* rename cast opcodes, fix for 32bit cast, fix python pretty printer (#12207)Arne Döring2019-09-181-4/+4
|
* fixes #12195Araq2019-09-171-6/+14
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-5/+5
| | | | | * Remove sonsLen * Use Indexable
* error for NimNode index kind (#12154)Jasper Jenkins2019-09-081-6/+10
|
* fixes #12125 (#12131)Andreas Rumpf2019-09-061-11/+14
| | | | * fixes #12125
* fixes #11903 (#11908)Arne Döring2019-08-311-1/+3
|
* new gensym handling (#11985)Andreas Rumpf2019-08-231-1/+1
| | | | | | | | | | | * new .gensym implementation * make astspec test green again * introduce a --useVersion switch to group compatibility switches * fixes #10180 * fixes #11494 * fixes #11483 * object constructor fields and named parameters are also not gensym'ed * disabled broken package
* Lock semchecked ast for macros (#11883) [bugfix]Arne Döring2019-08-081-10/+15
| | | | | | * reject to modify type checked AST * add flag to back out * Introduce legacy feature set.
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-3/+3
| | | | * fixes #11847
* VM exception fixes (#11868)Oscar Nihlgård2019-08-021-2/+10
|
* Fix VM conversion to var type [bugfix] (#11866)Oscar Nihlgård2019-08-011-2/+2
|
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+1
|
* 'nim check' stability improvementsAraq2019-07-141-1/+9
|
* fixes #8405: -d:useNimRtl now works even when {.rtl.} procs are used at ↵Timothee Cour2019-07-031-1/+4
| | | | compile time; CTFFI now works with {dynlib} (#11635)