Commit Graph

145 Commits

Author SHA1 Message Date
Arne Döring
38893a34ee fixes #9829 (#11849)
(cherry picked from commit b73d097d36)
2019-08-13 16:59:49 +02:00
Oscar Nihlgård
64d1159054 VM exception fixes (#11868)
(cherry picked from commit 50e921bb94)
2019-08-12 12:11:25 +02:00
Oscar Nihlgård
ad623d138d Fix VM conversion to var type [bugfix] (#11866)
(cherry picked from commit 829f719670)
2019-08-12 11:22:26 +02:00
Andreas Rumpf
ae04734031 fixes tcompiletimerange [bugfix] (#11720)
(cherry picked from commit 2895ad70c8)
2019-07-15 08:06:47 +02:00
Araq
d91b4b1bb7 [bugfix] VM: finally do inheritance properly
(cherry picked from commit 7606efc0bf)
2019-07-15 08:06:46 +02:00
Andreas Rumpf
e74e85a41e fixes #11610 (#11659)
(cherry picked from commit 28c9c062a4)
2019-07-08 11:28:41 +02:00
narimiran
8dfebb3282 Revert "VM can now cast integer type arbitrarily. (#11459) [feature]"
This is a new feature, which shouldn't be backported.
2019-06-16 17:15:23 +02:00
Arne Döring
94177f7357 VM can now cast integer type arbitrarily. (#11459) [feature] 2019-06-10 19:58:11 +02:00
Araq
f844891e48 make megatest work with 'koch boot -d:release' too 2019-06-05 22:32:19 +02:00
Andreas Rumpf
7215341190 make fullpaths the default in error messages and stack traces for mor… (#11385)
* make fullpaths the default in error messages and stack traces for more convenient development
* split up -d:release into -d:release and -d:danger flags
* workaround a Nim config parser bug
* fixes an old nim config parser bug
* make megatest green again
* make nimpretty tests work again
* make nimsuggest green
2019-06-05 08:02:54 +02:00
narimiran
a8939686a1 close #8199 by adding a test 2019-05-29 14:47:45 +02:00
narimiran
379916c737 make tests green 2019-05-28 07:31:25 +02:00
narimiran
0fc42fc4f7 tableinstatic test: make it arch-independed 2019-05-27 21:41:24 +02:00
Arne Döring
f94ec363ab Allow void macro result (#11286)
* allow void macro result
* add test for void macro result type
2019-05-21 21:31:40 +02:00
Aditya Siram
cc2be5e4c6 Fixes #11045. Assigning a proc to const and invoking. (#11076) 2019-05-04 22:57:15 +02:00
cooldome
041d15392a Compiler plugin for implementing incremental computation in user space (#10819)
This plugin provides essential building block for implementing incremental computations in your programs. The idea behind incremental computations is that if you do the same calculation multiple times but with slightly different inputs you don't have to recompute everything from scratch. Also you don't want to adopt special algorithms either, you would like to write your code in standard from scratch manner and get incrementality for free when it is possible.

The plugin computes the digest of the proc bodies, recursively hashing all called procs as well . Such digest with the digest of the argument values gives a good "name" for the result. Terminology loosely follows paper "Incremental Computation with Names" link below. It works well if you have no side effects in your computations. If you have global state in your computations then you will need problem specific workarounds to represent global state in set of "names" . SideEffect tracking in Nim also useful in this topic.

Classical examples:

Dashboard with ticking data. New data arrives non stop and you would like to update the dashboard recomputing only changed outputs.
Excel spreadsheet where user changes one cell and you would like to recompute all cells that are affected by the change, but do not want to recompute every cell in the spreadsheet.
2019-04-11 23:09:11 +02:00
Andreas Rumpf
0b2a3f6f7f fixes #10886 [backport] (#10897) 2019-03-23 14:44:53 +01:00
Andreas Rumpf
142a2d3551 added system.default in order to prevent the abstraction inversion that 'template default(T): untyped = (var x: T; x)' causes 2019-03-05 09:54:59 +01:00
Andreas Rumpf
c5dbb0379f disable compile-time FFI support 2019-02-23 11:34:39 +01:00
Timothee Cour
adbabf145c FFI at CT (#10150)
* enable FFI at CT
* rename useFFI=>nimHasLibFFI; improve formatting rawExecute traceCode
* disable libffi on windows (works for win32, not yet win64)
2019-02-23 11:31:01 +01:00
Arne Döring
28394153ab 32 bit fixes (#10608) 2019-02-13 23:30:14 +01:00
LemonBoy
710cfcecd3 Rework exception handling in the VM (#10544)
* Rework exception handling in the VM

Make the safepoint handling more precise and less forgiving.
The new code is clearer and more commented.
Perform cleanup on `return`.
The no-exception-thrown case in a try block should be slightly faster
since we don't parse the whole set of exceptions every time.
More tests.

* Fix silly error that broke a few tests

* Testament doesn't like files having the same name

* Remove test case that failed compilation to js
2019-02-08 11:57:47 +01:00
Arne Döring
b80dbdb77d Fix vm signed xor (#10519)
* fix #10482

* undo changes

* fix for bitwise not

* remove dead opcode
2019-02-01 12:12:10 +01:00
cooldome
1d5437e9d2 vm fix for bitwise signed ints (#10507)
* fixes #10482

* add missing file

* bug fix
2019-01-31 19:48:39 +01:00
LemonBoy
9c0e5c4c07 Harmonize the var/let and const handling (#10410)
Fixes #10333
2019-01-23 11:10:51 +01:00
Neelesh Chandola
226c15499f Fix compileTime pragma applying to whole var/let section (#10389) 2019-01-22 07:55:11 +01:00
LemonBoy
44c04b3571 Object downconversion in VM should not copy (#10378)
Hopefully the type-check phase already rejected all the invalid
conversions by the time we execute the VM bytecode.

Problem reported by chrisheller on the Nim Forum
2019-01-22 07:36:40 +01:00
Oscar Nihlgård
a4cdd25b19 Support system.reset in vm (#10400) 2019-01-21 17:00:33 +01:00
Timothee Cour
6ce3949c8a add isNamedTuple; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070)
* add `isNamedTuple`; make $(1, 2) be (1, 2) instead of leaking implementation detail (Field0: 1, Field1: 2)
  fixes this: #8670 (comment) /cc @alehander42 @Vindaar @mratsim

* Note: isNamedTuple is useful in other places, eg #10010 (comment)

* move isNamedTuple to helpers.nim to avoid exposing new symbol to system.nim

* remove workaround in tests/vm/tissues.nim failing test now that #10218 was makes it work
2019-01-08 18:37:25 -08:00
deech
e87910197a Check there are no side effects before optimizing away compile time expressions. (#9934) 2018-12-31 14:41:24 +01:00
Timothee Cour
c4e3c4ca2d add getCurrentCompilerExe to vmops (eg allows to get nim compiler at CT); add tests for vmops (#9925) 2018-12-18 09:07:12 +01:00
Araq
3b783f7e13 Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
Arne Döring
a5ecbf823f lots of small changes 2018-12-11 21:23:22 +01:00
Arne Döring
2a4c09ff88 megatest can be executed 2018-12-11 21:23:21 +01:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Timothee Cour
f838b1e6c1 fix #9872: setLen now works properly at CT [backport] 2018-12-08 14:33:42 -08:00
Araq
562d185cb7 cleanup tests; don't use non-working 'msg' spec field 2018-11-23 13:16:45 +01:00
Arne Döring
be553e691b more eyewash 2018-11-23 11:58:31 +01:00
Arne Döring
e012eb1001 updated tests to be executed 2018-11-23 11:58:28 +01:00
Arne Döring
031bfdec6f make run the default action of a test in tester 2018-11-23 11:58:28 +01:00
Randy Smith
6c7abe6e5b Fixes #9671 (#9750) 2018-11-19 09:22:21 +01:00
cooldome
8c1083d3b7 Of operator in vm fixes [backport] (#9717)
* fixes #9701
*  fixes #9702
* optimize of statement to bool
2018-11-15 13:03:42 +01:00
Ian
5ddeead29c #9348 Merge some small test files (#9561)
* Consolidated types issue tests
* Consolidated vm issue tests
2018-10-30 06:30:39 +01:00
Utwo
a68a4bfaf2 Remove install.txt and readme.txt (#9521)
* Remove install.txt and readme.txt

* Refactor tests that use readme.txt

* Tests open own source code
2018-10-28 13:36:52 +01:00
Arne Döring
2fa13040b9 Merge pull request #9496 from cooldome/vm_float_casts
VM: add int <-> float casts of the same size
2018-10-28 11:56:30 +01:00
Kaushal Modi
f8cef575b3 Improve dumpLisp macro (#9515)
* Improve dumpLisp macro

- Remove commas from the lisp representation of the AST.
- Make the dumpLisp output "pretty" and indented.
- Improve docs of `dumpTree` and `dumpLisp` macros.

With:

    dumpLisp:
      echo "Hello, World!"

Output before this commit:

    StmtList(Command(Ident("echo"), StrLit("Hello, World!")))

Output after this commit:

    (StmtList
     (Command
      (Ident "echo")
      (StrLit "Hello, World!")))

* Re-use the traverse proc inside treeRepr for lispRepr too

- Add module-local `treeTraverse` proc.
- Also fix treeRepr/dumpTree not printing nnkCommentStmt node contents.

* More doc string updates

* Allow unindented lispRepr output for tests

* Update a test affected by the lispRepr change

* Fix dumpTree

* Add note about lispRepr and dumpLisp to changelog [ci skip]
2018-10-27 14:10:05 +01:00
Andrii Riabushenko
a54e0703a9 Add test 2018-10-24 20:29:51 +01:00
Miran
749dbce4c6 Merge tests into a larger file (part 5 of ∞) (#9368)
* merge magics

* merge metatype tests

* merge method tests

* merge objects tests

* change `import future` to `import sugar`

Nim in Action tests are left with `import future`, to ensure compatibility.

* merge overload tests

* merge proc tests

* merge procvar tests

* merge range tests

* merge seq tests

* merge sets tests

* remove wrong assert from `tsets3`

* fix `jsTests`

* better fix
2018-10-16 10:50:10 +02:00
LemonBoy
ee14ace5d3 Field checks for everybody (#8957)
* Field checks for JS backend

* Clean nkCall nodes with no arguments

Generating a nkEmpty in place of no arguments makes no sense form the
AST point of view and also trips up the VM codegen.

* Field checks for VM backend

* Test case for #6612

This patchset fixes #6612

* Add test case for LHS double evaluation

* Prevent LHS double-eval for JS backend

* Prevent double evaluation in VM backend
2018-10-09 19:54:12 +02:00
LemonBoy
fb54f394e8 Fix for VM codegen with static[T] types
Fixes #9043
2018-09-23 18:17:00 +02:00