Commit graph

157 commits

Author SHA1 Message Date
Clyybber
3e52136f26 Cosmetics 2020-07-10 13:36:02 +02:00
Clyybber
27579cfd3a
Make arc compile laser again 2020-07-08 16:20:16 +02:00
Andreas Rumpf
06d776a582
fixes #14900, this time for real, maybe (#14934) 2020-07-08 14:47:14 +02:00
Araq
ecf8cbbbe0 fixes #14900 2020-07-08 10:48:12 +02:00
Araq
cdce245a23 fixes #14899 2020-07-08 10:48:12 +02:00
Araq
b17e1efc67 progress 2020-07-08 10:48:12 +02:00
Andreas Rumpf
a61a7889b8
injectdestructors: refactoring, added more cases explicitly (#14929) 2020-07-07 17:47:57 +02:00
Andreas Rumpf
1854d29781
scoped memory management (#14790)
* fixes the regressions
* closes #13936
* scope based memory management implemented
* enabled tcontrolflow.nim test case
* final cleanups
2020-07-04 07:37:24 +02:00
Clyybber
62394616e8
DFA and injectdestructors cleanup (#14824)
* DFA and injectdestructors cleanup

* More precise write analysis

* Cleanup obsoleted path

* Unify defInstrTargets and useInstrTargets

* Misc cleanups

* Nicer CFG printing

* Misc cleanups 2
2020-06-28 19:36:30 +02:00
Clyybber
52841dba09
Fix #14568 (#14583)
* Fix #14568
* Add testcase
* Fix bogus test
* Adapt other failing tests
* Declarations are always first writes
2020-06-07 23:32:41 +02:00
Andreas Rumpf
419dbd573d
fixes #14118 (#14595) 2020-06-07 20:11:42 +02:00
Andreas Rumpf
e31ac81899
more checking for --gc:arc, no need for valgrind (#14467)
* sigmatch: removed dead code
2020-05-29 12:08:17 +02:00
Clyybber
9f78f116b2
New "ping-pong" DFA (#14322)
* New ping-pong analysis

* Add testcase for #13456

* Remove debugging leftover

* Unquote "unstructured controlflow"

* Fix typo

* Fix exponential complexity in edge cases

* Add sanity testcase

* Fix
2020-05-15 19:24:43 +01:00
b3liever
09ea8f9cf8
fix detecting closure env for nested asts (#14326)
Co-authored-by: b3liever <b3liever@yandex.com>
2020-05-12 20:09:56 +02:00
cooldome
a39123c93c
fix #14219 (#14225)
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-05-11 23:11:20 +02:00
b3liever
a081b10b54
small refactoring (#14303)
Co-authored-by: Antonis <b3liever@yandex.com>
2020-05-11 19:12:25 +02:00
Antonis
517dd800f8 better error message 2020-05-11 15:39:44 +02:00
Antonis
3616b0698b fix closure env check 2020-05-11 15:39:44 +02:00
Clyybber
42db75c970
Fix the DFA for "unstructured controlflow" (#14263)
* Fix the DFA for "unstructured controlflow"

* Add testcase from #14233
2020-05-07 21:41:55 +02:00
Andreas Rumpf
b6fb609e0d
destructors: don't produce stupid code for 'cast' (#14208) [backport:1.2]
* destructors: don't produce stupid code for 'cast'

* fixes #14207
2020-05-04 07:43:22 +02:00
cooldome
d3b0132061
Step2: fixes #13781, fixes #13805 (#13897)
* Fix sym owner in wrapper proc
* threadpool changes
* revert lowerings
* add newFastMoveStmt
* try fixing test by switching to cpp

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-16 23:27:08 +02:00
cooldome
9295251e68
Implements RFCs #209 (#13995)
* add test
* add changelod entry
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-16 21:04:05 +02:00
Andreas Rumpf
fc5dd11b3d
fixes #13722 (#13729)
* fixes #13722

* better fix
2020-03-23 15:47:10 +01:00
Araq
ee440df02d disable even more of scope based destruction handling; fixes #13709 2020-03-23 12:05:59 +01:00
Andreas Rumpf
034dad8e32
fixes #13691 (#13694) 2020-03-19 12:57:45 +01:00
Andreas Rumpf
fb641483f0
arc optimizations (#13325)
* scope based destructors
* handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim
* make this branch mergable, logic is disabled for now
2020-03-18 16:57:34 +01:00
Andreas Rumpf
a87062393a
fixes #13622 (#13679) 2020-03-18 13:42:33 +01:00
cooldome
35d14095ed
Fixes #13659 (#13674)
* fixes #13659

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-03-17 16:36:38 +01:00
Andreas Rumpf
090ba1e3a3
fixes #13436 (#13615) 2020-03-10 00:52:46 +01:00
Andreas Rumpf
a0eca75182
sink parameter inference for types that have destructors (#13544)
* ensure capitalize doesn't take an inferred sink parameter

* sink parameter inference: first version, for now disabled. Changed that sink parameters can be consumed multiple times in order to adhere to our spec.

* sink inference can now be disabled with .nosinks; sometimes for proc type interop this is required

* fixes yet another critical DFA bug

* better implementation that also understands if expressions etc

* document sink parameter inference and allow for global disabling
2020-03-04 14:28:53 +01:00
cooldome
7dd787b8a3
fixes #13368 (#13397) 2020-02-14 10:13:55 +01:00
Araq
a10cc18247 ARC: optimize complete object constructors to use nimNewObjUninit 2020-01-26 13:43:02 +01:00
cooldome
f51613e262
make sink operator optional (#13068)
* make sink operator optional

* bug fix, add changelog entry

* Trigger build

* fix one regression

* fix test

* Trigger build

* fix typos
2020-01-17 11:44:06 +00:00
Clyybber
e3acb2d12c
Cleanup DFA (#13173) 2020-01-16 20:15:50 +01:00
Andreas Rumpf
a5e67071d2
ARC: misc bugfixes (#13156)
* fixes #13102
* closes #13149
* ARC: fixes a move optimizer bug (there are more left regarding array and tuple indexing)
* proper fix; fixes #12957
* fixes yet another case object '=' code generation problem
2020-01-15 22:13:31 +01:00
Andreas Rumpf
d56848878c
fixes #13119 (#13128)
* fixes #13119
* fixes a regression
2020-01-14 09:56:08 +01:00
Clyybber
ba4fbb6328 Continue #13002 (#13021) 2020-01-06 11:40:42 +00:00
Andreas Rumpf
fb1b51f1e3
fixes #12956 (#13020) 2020-01-03 17:36:09 +01:00
cooldome
002d50f1f0 Sink to MemMove optimization in injectdestructors (#13002) 2020-01-02 22:58:01 +01:00
cooldome
584e8c8283 fixes #12989 (#12992)
* fixes #12989
* Revert "remove unwanted changes"

This reverts commit 501829732a8e44deef2d815c303859efbe452cb5.
2019-12-31 21:13:26 +01:00
Andreas Rumpf
83a736a34a
ARC: cycle detector (#12823)
* first implementation of the =trace and =dispose hooks for the cycle collector
* a cycle collector for ARC: progress
* manual: the .acyclic pragma is a thing once again
* gcbench: adaptations for --gc:arc
* enable valgrind tests for the strutils tests
* testament: better valgrind support
* ARC refactoring: growable jumpstacks
* ARC cycle detector: non-recursive algorithm
* moved and renamed core/ files back to system/
* refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
2019-12-17 17:37:50 +01:00
Andreas Rumpf
3524944e21
ARC: fixes cycle detection and move the .cursor attribute into closures (#12872) 2019-12-11 06:57:00 +01:00
Andreas Rumpf
b8152b29e8
ARC: yet another bugfix (#12871) 2019-12-10 16:44:54 +01:00
Andreas Rumpf
3fbb3bfd3f ARC related bugfixes and refactorings (#12781) 2019-12-05 16:59:06 +01:00
Araq
b688250202 fixes #12766 2019-11-29 19:46:21 +01:00
Araq
2dea920379 ARC: implemented a simple cycle detector 2019-11-28 23:00:34 +01:00
Clyybber
7e747d11c6 Cosmetic compiler cleanup (#12718)
* 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
2019-11-28 17:13:04 +01:00
Andreas Rumpf
5278cf80eb
ARC: closure bugfixes (#12677)
* ARC: closure bugfixes
* progress
* ARC closures: create =hooks for captured parameters
* ARC: always destroy constructions like tuples, arrays properly, even in edge cases
* fixes a regression
2019-11-18 12:33:44 +01:00
Andreas Rumpf
76179cbec2
ARC: fixes leaking new() statement (#12665) 2019-11-15 12:38:11 +01:00
Araq
f22d3c75aa ARC: closure inside object constructor now works 2019-11-13 23:29:21 +01:00