summary refs log tree commit diff stats
path: root/compiler/liftdestructors.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #20139; hash types based on its path relative to its package path ↵ringabout2023-03-021-2/+2
| | | | | | | | | | | | | | | (#21274) [backport:1.6] * fixes #20139; hash types based on its path relative its project * add a test case * fixes procs * better implementation and test case --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #19291; implements `wasMoved` hook (#21303)ringabout2023-03-021-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #19291; implements `wasMoved` hook * basics * checkpoint * finish `wasMoved` * add a test for #19291 * add documentation and changelog * work `attachedWasMoved` with generics * fixes optimizer * register `=wasMoved` * handle wasMoved magcis * check another round * some patches * try `op == nil` * nicer * generate `wasMoved` before `destroy` * try again * fixes tests * default wasMoved * Update tests/destructor/tv2_cast.nim * Update tests/destructor/tv2_cast.nim * Update tests/arc/topt_refcursors.nim
* fixes comments about type bound operations (#21365)ringabout2023-02-141-1/+1
|
* fixes #21171; dynamic acyclic refs need to use dyn decRef (#21184)ringabout2022-12-281-0/+7
| | | | | | | * fixes #21171; dyn destructors for acyclic inherited refs * add a test * Update compiler/liftdestructors.nim
* Prevent use-after-free bugs in object variants. Fixes bug #20305 (#20300) ↵Antonis Geralis2022-09-051-0/+3
| | | | | | | | | | | [backport] prevent use-after-free bugs in cased objects the bug happens specifically when deleting an item in a seq. The item taking it's place might not have the same case fields. Then =sink(x[i], move x[xl]) might leave the deleted fields still in memory! If the new item switches branches again, you get a use-after-free bug.
* move assertions out of system (#19599)flywind2022-03-231-0/+3
|
* fixes an old ARC bug: the produced copy/sink operations don't copy the ↵Andreas Rumpf2021-12-091-0/+10
| | | | hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)
* fixes #17893 (#18485)Andreas Rumpf2021-07-131-6/+1
| | | * fixes #17893
* ORC: support for custom =trace procs (#18459)Andreas Rumpf2021-07-091-2/+14
| | | | | | | | | | | * 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>
* ORC: use =destroy instead of =dispose (#18440)Andreas Rumpf2021-07-071-40/+9
| | | | | | * ORC refactoring in preparation for further changes (=dispose must die) * ORC: embrace =destroy, avoid =dispose * ORC: no need for =dispose * closes #18421
* ORC: progress (#18000)Andreas Rumpf2021-05-121-6/+8
| | | | | | | | | * ORC: progress * ORC: bugfix; don't follow acyclic data even if only at runtime the subtype is marked as acyclic * progress * minor style changes
* ORC: improvements (#17993)Andreas Rumpf2021-05-121-2/+7
| | | | * ORC: improvements * ORC: fix .acyclic annotation for ref objects
* ORC: critical bugfix for mixing acyclic refs with cyclic refs [backport:1.4] ↵Andreas Rumpf2021-05-111-7/+10
| | | | (#17991)
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-1/+1
| | | | cstring, not cString (#17744)
* iterable[T] (#17196)Timothee Cour2021-04-111-1/+1
| | | | | | | | * fix failing test toSeq in manual which now works * changelog * reject proc fn(a: iterable) * add iterable to spec * remove MCS/UFCS limitation that now works
* Fix #17412 (#17560)Clyybber2021-03-291-1/+10
| | | | | * Fix #17412 * Address review
* IC: green tests (#17311)Andreas Rumpf2021-03-191-36/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * IC: renamed to_packed_ast module to ic module * IC: don't store the --forceBuild flag, makes it easier to test * IC: enable hello world test * Codegen: refactorings for IC; changed the name mangling algorithm * fixed the HCR regressions * life is too short for HCR * tconvexhull is now allowed to use deepCopy * IC exposed a stdlib bug, required a refactoring * codegen: code cleanups * IC: even if a module is outdated, its dependencies might come from disk * IC: progress * IC: better name mangling, module IDs are not stable * IC: another refactoring helping with --ic:on --gc:arc * disable arraymancer on Windows for the time being * disable arraymancer altogether * IC: make basic test work with 'nim cpp' * IC: progress on --ic:on --gc:arc * wip; name mangling for type info
* semLambda removed, semProcAux reworked (#17379)Saem Ghani2021-03-171-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* new-style concepts implementation, WIP (#15251)Andreas Rumpf2021-02-241-1/+1
| | | | | | | | | | | | | * fixes #15210 [backport:1.2] * make tests green * make ordinal work * makes Swapable test compile * make Indexable example work * concepts: 'self' is now 'Self' * concepts: make Dictionary example compile * document the new concept implementation * concepts: make typeDesc work properly * concepts: allow documentation comments (d'oh)
* IC: next steps (#16729)Andreas Rumpf2021-01-231-36/+56
| | | | | | | | | | | * IC: dead code elimination pass * preparations for a different codegen strategy * added documentation to the newly written code * IC: backend code * IC: backend adjustments * optimized the compiler a bit * IC: yet another massive refactoring * fixes regressions * cleanups
* Fix 16722 (#16730)cooldome2021-01-151-1/+1
| | | | | | | * fix #16722 * fix spacing * spacing
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-10/+10
| | | | | | | | | | | | | | | | | | | * 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>
* ORC: prepare for another patent-pending optimization (#15996)Andreas Rumpf2020-11-181-11/+44
| | | | | | | | | | | | | | | | | * ORC: prepare for another patent-pending optimization * bugfix * '=copy' for refs can take a cyclic parameter for more ORC optimizations * ORC: exploit the common 'it = it.next' pattern * can't hurt to check for nil * use an algorithm that is not obviously broken * restore the test case * final cleanups for --gc:orc
* fix #15910 (#15984)cooldome2020-11-161-4/+12
| | | | | | | * fix #15910 * produce op of op is nil * Trigger build
* fixes #15753 [backport:1.4] (#15971)Andreas Rumpf2020-11-151-19/+76
|
* ARC now capable of custom extra alignment. Ref, closure and seq support. ↵cooldome2020-10-281-2/+6
| | | | (#15697)
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-46/+53
| | | | | | | | | | | | | | | | | * 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)
* ORC: critical bugfix for the cycle analyser, introduce -d:nimStressOrc for ↵Andreas Rumpf2020-10-141-1/+1
| | | | easier stress testing (#15572)
* allow old styled RTTI for arc/orc (#15331)Andreas Rumpf2020-09-161-2/+2
|
* fixes #15076 (#15329)Andreas Rumpf2020-09-151-0/+1
|
* fixes #15122 (#15301)Andreas Rumpf2020-09-111-2/+15
|
* Big compiler Cleanup (#14777)Clyybber2020-08-281-5/+0
|
* fixes #15076 (#15095)Andreas Rumpf2020-07-271-0/+2
|
* ARC: optimize the code better when --panics:off (#15031)Andreas Rumpf2020-07-211-18/+24
|
* Move `wasMoved` out of `=destroy`Clyybber2020-07-101-9/+1
|
* remove tyOpt, mOpt (#14636)Timothee Cour2020-06-121-1/+2
| | | | | * remove tyOpt, mOpt * fixup
* fixes #14495 [backport:1.2] (#14496)Andreas Rumpf2020-05-291-4/+4
|
* fix one motr dicriminator bugcooldome2020-05-121-2/+7
|
* fix testcooldome2020-05-121-3/+5
|
* fix #14312cooldome2020-05-121-6/+9
|
* fix #14294 (#14301)cooldome2020-05-111-1/+6
| | | | | | | * fix #14294 * fix orc as well Co-authored-by: cooldome <ariabushenko@bk.ru>
* fix #14236 (#14250)cooldome2020-05-071-3/+3
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #14244 (#14248)cooldome2020-05-061-6/+6
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes a critical =trace generation bug (see test case) (#14140)Andreas Rumpf2020-04-271-1/+5
|
* cycle collector (#14071)Andreas Rumpf2020-04-221-3/+3
| | | | * figured out the wrong cycle trace proc problem * cycle collector/break refactorings and minor improvements
* Implements RFCs #209 (#13995)cooldome2020-04-161-59/+115
| | | | | * add test * add changelod entry Co-authored-by: cooldome <ariabushenko@bk.ru>
* fixes #13810 (#13821)cooldome2020-03-311-1/+1
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* cycle breaker (#13593)Andreas Rumpf2020-03-191-4/+3
| | | | * cycle breaking as an alternative to cycle detection
* fixes #13269 (#13344)Andreas Rumpf2020-02-071-3/+6
|
* fixes #13110 (#13197)Andreas Rumpf2020-01-191-1/+0
|