| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
enabled (#24108)
refs #24094, soft reverts #23787
#23787 turned out to cause issues as described in #24094, but the
changes are still positive, so it is now only enabled if compiling with
`-d:nimOptIters`. Unfortunately the changes are really interwoven with
each other so the checks for this switch in the code are a bit messy,
but searching for `nimOptIters` should give the necessary clues to
remove the switch properly later on.
Locally tested that nimlangserver works but others can also check.
|
| |
|
|
|
| |
fixes #24033
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This pr redefines the relation between lambda lifting and closureiter
transformation.
Key takeaways:
- Lambdalifting now has less distinction between closureiters and
regular closures. Namely instead of lifting _all_ closureiter variables,
it lifts only those variables it would also lift for simple closure,
i.e. those not owned by the closure.
- It is now closureiter transformation's responsibility to lift all the
locals that need lifting and are not lifted by lambdalifting. So now we
lift only those locals that appear in more than one state. The rest
remains on stack, yay!
- Closureiter transformation always relies on the closure env param
created by lambdalifting. Special care taken to make lambdalifting
create it even in cases when it's "too early" to lift.
- Environments created by lambdalifting will contain `:state` only for
closureiters, whereas previously any closure env contained it.
IMO this is a more reasonable approach as it simplifies not only
lambdalifting, but transf too (e.g. freshVarsForClosureIters is now gone
for good).
I tried to organize the changes logically by commits, so it might be
easier to review this on per commit basis.
Some ugliness:
- Adding lifting to closureiters transformation I had to repeat this
matching of `return result = value` node. I tried to understand why it
is needed, but that was just another rabbit hole, so I left it for
another time. @Araq your input is welcome.
- In the last commit I've reused currently undocumented `liftLocals`
pragma for symbols so that closureiter transformation will forcefully
lift those even if they don't require lifting otherwise. This is needed
for [yasync](https://github.com/yglukhov/yasync) or else it will be very
sad.
Overall I'm quite happy with the results, I'm seeing some noticeable
code size reductions in my projects. Heavy closureiter/async users,
please give it a go.
|
|
|
| |
fixes https://forum.nim-lang.org/t/10807
|
|
|
| |
fixes #19977
|
|
|
| |
fixes #15924
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fixes https://github.com/nim-lang/Nim/issues/22619
It causes double free for closure iterators because cursor fields are
destroyed in the lifted destructors of `Env`.
Besides, according to the Nim manual
> In fact, cursor more generally prevents object
construction/destruction pairs and so can also be useful in other
contexts.
At least, destruction of cursor fields might cause troubles.
todo
- [x] tests
- [x] revert a certain old PR
---------
Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#22559)
* fix #22548;environment misses for type reference in iterator access nested in closure
* fix #21737
* Update lambdalifting.nim
* remove containsCallKinds
* simplify
|
|
|
|
|
| |
* fix #20891 Illegal capture error of env its self
* fix innerClosure too earlier, make condition shorter
|
|
|
|
|
|
|
| |
(#22154)
* fixes #22148; std/memfiles.memSlices nesting now fails with memory safety capture violation
* adds a test case
|
|
|
| |
fixes #21110; duplicate proc definitions for iters
|
|
|
| |
A for expression now can have a generated iterator, allowing for more composable iterables
|
|
|
|
|
|
|
|
|
|
|
| |
introducing new local vars [backport: 1.6] (#21489)
* fixes #21306; don't transform yields in the var section when introducing new local vars
* adds `inVarSection` so the var section in the var section is freshed
* use `isIntroducingNewLocalVars` to avoid yield transformations in var sections
* fixes comments
|
|
|
|
|
|
|
|
|
|
|
| |
generate an implicit uninitialized let statement (#21081)
* fixes #21043; fixes a named exception in the infixAs expression which generate an implicit uninitialized let statement
* Update compiler/sempass2.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unnamed break in the block now gives an error
* bootstrap
* fixes
* more fixes
* break with label
* label again
* one moee
* Delete test5.txt
* it now gives a UnnamedBreak warning
* change the URL of bump back to the original one
|
|
|
|
|
|
|
| |
Fix double defer with break in closureiterators
Signed-off-by: Tanguy <tanguy@status.im>
Signed-off-by: Tanguy <tanguy@status.im>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* defaults to Orc
* bootstrap using refc
* use gc
* init orc defines
* unregister orc
* fix gc
* fix commands
* add prepareMutation for orc
* enable deepcopy for orc
* prepareMutation
* more fixes
* some cases
* bug #20081
* partial fixes
* partial fixes
* fixes command line
* more fixes
* build Nim with refc
* use gc
* more fixes
* rstore
* orc doesn't support threadpool
* more shallowCopy
* more fixes
* fixes unsafeNew
* workarounds
* small
* more fixes
* fixes some megatest
* tcodegenbugs1 refc
* fxies megatest
* build nimble with refc
* workaround tensordsl tests
* replace shallowCopy with move
* fixes action
* workaround
* add todo
* fixes important packages
* unpublic unregisterArcOrc
* fixes cpp
* enable windows
Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* remove deprecated pragma syntax from 0.20.0
closes #4651, closes #16653 with a cheap fix for now due to
how early `tfFinal` is set
* remove type pragma between name and generics
* undo removal, try removing bind expression (0.8.14)
* fix test, unremove bind expr
* remove again
* Update changelog.md
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* dependencies @ HEAD & weave test dependencies
* try fix package ci
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix nested finally handling in closureiters
* Fix CI
* review comment
* third time the charm
* Update compiler/closureiters.nim
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Fix bug in freshVarForClosureIter. Fixes #18474.
freshVarForClosureIter was returning non-fresh symbols sometimes.
Fixed by making addField return the generated PSym.
* remove discardable
Co-authored-by: Nick Smallbone <nick@smallbone.se>
|
|
|
|
|
| |
* fixes #19575
* better bugfix
|
|
|
|
|
| |
* style usages (openArray)
* revert doc changes
|
| |
|
| |
|
|
|
|
|
| |
* what does wrt mean?
* clarify
|
|
|
|
|
|
|
|
|
|
|
| |
* silence error output from template_various.nim
* any => auto in tests
* avoid showing failed for parseSpec since this is expected behavior in 2 cases: tincludefile.nim, tnav1.nim
* enforce InheritFromException
* fixup
|
|
|
|
|
|
| |
* Fixes #17849
* Update compiler/closureiters.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
|
|
|
|
|
|
|
|
| |
* fix nim js cmp fails at CT
* follow up #17486
* test more branches
* better
|
|
|
|
| |
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
pointless alias target vs targets; document matrix; DRY (#16343)
* testament: error instead of silently ignore invalid targets
* s/target/targets/
* fix test; refs #16344
* address comments
* Update testament/specs.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
|
| |
|
| |
|
|
|
|
|
| |
* Add a test-case for #12576
* Add a test-case for #12523
|
| |
|
| |
|
|
|
| |
This reverts commit a5f02cac85281fc2804e910f330f0c11d3c4f77b.
|
|
|
|
|
| |
* fix #13417
* add test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* config update
* disable a questionable test
* remove c++ exception handling IDs, new impl doesn't require it anymore
* C++ based exceptions finally work
* fixes bootstrapping problem in C++ mode
* teach GCC it's 2020 now
* more bugfixes for C++ based exception handling
* apply cooldome's patch
* another attempt to enable C++11
* bug fix
Co-authored-by: Araq <rumpf_a@web.de>
Co-authored-by: cooldome <ariabushenko@bk.ru>
|
|
|
|
|
|
|
| |
* fixes #12747
* fix tests
* improve code style
Co-authored-by: cooldome <ariabushenko@bk.ru>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* refactor illegal iterator assignment detection
* delete crappy test
|
| |
|
|
|
|
|
|
|
| |
* lent iterators
* rebase tests
* update changelog
* fix comments, more tests
|