| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
fixes #24141
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
fixes #23454
|
|
|
|
|
| |
iterators (#23986)
fixes #23982
|
|
|
|
| |
fixes #22389;
fixes #19840
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
for loop (#23540)
fixes #23536
|
|
|
|
|
|
|
|
| |
fixes #4299
fixes #12492
fixes #10849
It binds `function` with `env`: `function.bind(:env)` to ease codegen
for now
|
| |
|
| |
|
|
|
| |
fixes #19977
|
| |
|
|
|
|
|
|
| |
Done:
- [x] Implement conversions to openArray/varargs.
- [x] Implement index/range checking.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* wip; use strictdefs for compiler
* checkpoint
* complete the chores
* more fixes
* first phase cleanup
* Update compiler/bitsets.nim
* cleanup
|
|
|
|
|
| |
loop in ORC (#22240)
fixes #22237; fixes #21160; wrong cursor on unowned parameters
|
|
|
|
|
|
|
| |
(#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
|
|
|
| |
fixes explicit deref
|
|
|
|
|
|
|
|
|
|
|
| |
(#21667)
* refactoring in preparation for better, simpler name mangling that works with IC flawlessly
* use new disamb field
* see if this makes tests green
* make tests green again
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
properly (#21688)
* fixes #21540; deref block at transf phase to make injectdestructors function properly
* add a test case
* add one more test
* fixes the type of block
* transform block
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
`newNodeIT` has already assigned `n.typ` to x.
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #20856; store defaults directly
* fixes
* fixes
* check
* fixes
|
|
|
|
|
|
| |
* add test case
* refactoring transformAddrDeref and fix #18079
* fix jsgen
|
|
|
|
|
|
|
| |
* refactoring
* refactoring: removed unused macroUsagesSection
* enum instead of bool for better readability
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fresh start
* add cpp target
* add result support
* add nimPreviewRangeDefault
* reduce
* use orc
* refactor common parts
* add tuple support
* add testcase for tuple
* cleanup; fixes nimsuggest tests
* there is something wrong with cpp
* remove
* add support for seqs
* fixes style
* addd initial distinct support
* remove links
* typo
* fixes tuple defaults
* add rangedefault
* add cpp support
* fixes one more bugs
* add more hasDefaults
* fixes ordinal types
* add testcase for #16744
* add testcase for #3608
* fixes docgen
* small fix
* recursive
* fixes
* cleanup and remove tuple support
* fixes nimsuggest
* fixes generics procs
* refactor
* increases timeout
* refactor hasDefault
* zero default; disable i386
* add tuples back
* fixes bugs
* fixes tuple
* add more tests
* fix one more bug regarding tuples
* more tests and cleanup
* remove messy distinct types which must be initialized by original types
* add tests
* fixes zero default
* fixes grammar
* fixes tests
* fixes tests
* fixes tests
* fixes comments
* fixes and add testcase
* undo default values for results
Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
* produce better code for closure environment creation
* new 'first write' analysis;
* scope based move analyser
* code cleanup
Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* continue #9582 for consts, close #9331, fix #20114
also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc
* changelog correctly
* fix jsgen
* update tgetimpl
* fix sighashes
* fix #19766, add comment about postfix
* fix noRewrite LOL
refs #16620
* fix changelog
* fix destructors
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Fixed composite type class proc borrowing
* Moved borrow search into transf
* added borrow check to symbol flag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixes #12642
* update important packages; refs #18804
* fixes #18805; refs #18806
* fixes a regression
* Update testament/categories.nim
Co-authored-by: flywind <xzsflywind@gmail.com>
* progress
* progress
Co-authored-by: flywind <xzsflywind@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
cut the iterator yield into half) (#18767)
* test someSymFromImportTable
* Update compiler/lookups.nim
* test nkTupleConstr
* use isConstExpr
* add tests
* add comments and todo
* use todo
|
|
|
|
| |
cstring, not cString (#17744)
|
|
|
|
| |
* cleanups
* IC: bugfix
|
|
|
|
|
| |
* fixes #11225; generic sandwich problems; [backport:1.2]
* progress
* delegating these symbols must be done via 'bind'
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* fix spacing
* spacing
|
|
|
|
|
|
|
|
|
|
|
| |
* code cleanups
* refactorings for IC
* more refactorings for IC
* IC: attach the 'nil' type to its module
* IC: refactorings and improvements
* IC: progress
* IC: more serialization fixes
* IC: embarrassing omission
* code cleanups
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* cleanups
* ast.nim: cleanups
* IC: no more sym.tab field, stored externally in the module graph
* nimble compiles again
* rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly
* rodfiles: added compilerproc and export sections
* rodfiles: added all the missing sections
* rodfiles: track the missing information
* IC: architecture for lazy loading of proc bodies
* make tests green again
* completed the lazy loading of proc bodies
* symbol lookup integration, part 1
* symbol lookup integration, part 2
* symbol lookup integration, part 3
* make tcompilerapi work again
* rodfiles: fixed config change handling
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
| |
* fixes #16069; refs https://github.com/nim-lang/RFCs/issues/257 [backport:1.2] [backport:1.4]
* make tests green again
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|