summary refs log tree commit diff stats
path: root/compiler/liftdestructors.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #13269 (#13344)Andreas Rumpf2020-02-071-3/+6
|
* fixes #13110 (#13197)Andreas Rumpf2020-01-191-1/+0
|
* make sink operator optional (#13068)cooldome2020-01-171-11/+19
| | | | | | | | | | | | | | | | * make sink operator optional * bug fix, add changelog entry * Trigger build * fix one regression * fix test * Trigger build * fix typos
* ARC: misc bugfixes (#13156)Andreas Rumpf2020-01-151-22/+77
| | | | | | | | * 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
* fixes #13119 (#13128)Andreas Rumpf2020-01-141-1/+1
| | | | | * fixes #13119 * fixes a regression
* Sink to MemMove optimization in injectdestructors (#13002)cooldome2020-01-021-7/+0
|
* fixes #12899 (#12921)Andreas Rumpf2019-12-181-8/+12
| | | | | | * fixes #12899 * fixes regression: destroy global variables in reverse declaration order, closureleak test relies on it
* ARC: cycle detector (#12823)Andreas Rumpf2019-12-171-37/+121
| | | | | | | | | | | | | * 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
* fixes #12820 (#12828)cooldome2019-12-091-0/+7
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-36/+35
| | | | | | | | | | | | | | | | | | * 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
* [backport] Fix spelling typos (#12755)Brian Wignall2019-11-281-1/+1
|
* ARC: use the new .cursor annotation for 'up' pointersAraq2019-11-131-1/+1
|
* .cursor implementation (#12637)Andreas Rumpf2019-11-121-10/+20
| | | | | | | | | | | * cursors: first implementation * added currently failing test * .cursor works for doubly linked lists * make -d:useMalloc work again * added code to nil out refs in a destructor * it's now called --gc:arc * renderer.nim: render nkBreakState properly * make simple closure iterators work without leaking
* --gc:destructors: bugfixesAraq2019-11-091-6/+6
|
* --gc:destructors improvements (#12626)Andreas Rumpf2019-11-091-12/+17
| | | | | | * do not cache the noDestructors transformation * liftdestructor: improvements * undo bugfix
* --gc:destructors now means Nim uses pure refcounting (#12557)Andreas Rumpf2019-10-301-10/+67
|
* refactoring: use the new strings and seqs when optSeqDestructors is activeAraq2019-10-201-3/+3
|
* refactoring: --newruntime consists of 3 different switchesAraq2019-10-201-3/+3
|
* some gc:destructors progressAndreas Rumpf2019-09-161-1/+1
|
* fixes #12172Araq2019-09-131-1/+1
|
* fixes #12051Araq2019-09-101-1/+9
|
* gc:destructors progressAraq2019-09-011-2/+2
|
* lift destructor for openarray (#12073)cooldome2019-08-281-2/+6
| | | | * destroy for sink openarray
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-1/+1
| | | | * fixes #11847
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+1
|
* newruntime: refchecks:on|off switchAraq2019-07-121-2/+4
|
* fixes #11610 (#11659)Andreas Rumpf2019-07-051-1/+1
|
* [bugfix] owned closures (#11544)Andreas Rumpf2019-06-201-2/+12
|
* [bugfix] fixes #11517Araq2019-06-191-1/+6
|
* [refactoring] liftdestructors.nim is callable from lambdalifting; refs #11217Araq2019-06-121-95/+106
|
* [refactoring] liftdestructors is now a module of its ownAraq2019-06-121-10/+9
|
* fixes #6755; error message could be better but oh wellAraq2019-05-281-4/+6
|
* fixes #11215Araq2019-05-121-2/+2
|
* rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227)Arne Döring2019-05-111-1/+1
|
* Destructor lifting fixes #11149 (#11163)cooldome2019-05-041-8/+9
| | | | | | * fixes #11149 * add test
* fixes #11053Andreas Rumpf2019-04-191-5/+4
|
* destructors: internal compiler refactoringAraq2019-04-181-51/+18
|
* fixes #11014Araq2019-04-171-3/+3
|
* fixes #11004Araq2019-04-121-60/+72
|
* preparations for --newruntime owned refs/callbacksAraq2019-04-111-1/+1
|
* newruntime: raising an exception works but currently leaks memory because ↵Araq2019-04-101-2/+4
| | | | currentException global is not an 'owned' ref
* an owned ref parameter behaves as a 'sink' parameterAndreas Rumpf2019-04-071-3/+0
|
* more efficient enumToStr implementation that works without the old typeinfo ↵Andreas Rumpf2019-04-071-14/+0
| | | | structures
* fixes compiler regressionAraq2019-04-061-1/+4
|
* destructors: we are cooking nowAraq2019-04-061-5/+9
|
* destructors: progressAndreas Rumpf2019-04-051-2/+9
|
* fixes destructor tuple regression #10940 (#10941)cooldome2019-04-041-1/+1
| | | | | | | | * fixes #10940 * bug fixes * fix spacing
* newruntime: fixes codegen for closuresAraq2019-04-041-0/+2
|
* make megatest work againAraq2019-04-021-1/+2
|
* newruntime: progressAraq2019-04-021-5/+12
|
span>"LineNr"> 5 </span>== code <span id="L6" class="LineNr"> 6 </span> <span id="L7" class="LineNr"> 7 </span><span class="CommentedCode">#? Entry:</span> <span id="L8" class="LineNr"> 8 </span><span class="CommentedCode">#? # . prologue</span> <span id="L9" class="LineNr"> 9 </span><span class="CommentedCode">#? 89/&lt;- %ebp 4/r32/esp</span> <span id="L10" class="LineNr">10 </span><span class="CommentedCode">#? #</span> <span id="L11" class="LineNr">11 </span><span class="CommentedCode">#? 68/push 0xfcfdfeff/imm32</span> <span id="L12" class="LineNr">12 </span><span class="CommentedCode">#? b8/copy-to-eax 0x34353637/imm32</span> <span id="L13" class="LineNr">13 </span><span class="CommentedCode">#? $dump-stack0:</span> <span id="L14" class="LineNr">14 </span><span class="CommentedCode">#? (push-n-zero-bytes 4)</span> <span id="L15" class="LineNr">15 </span><span class="CommentedCode">#? 68/push 0x20/imm32</span> <span id="L16" class="LineNr">16 </span><span class="CommentedCode">#? $dump-stack9:</span> <span id="L17" class="LineNr">17 </span><span class="CommentedCode">#? b8/copy-to-eax 1/imm32/exit</span> <span id="L18" class="LineNr">18 </span><span class="CommentedCode">#? cd/syscall 0x80/imm8</span> <span id="L19" class="LineNr">19 </span> <span id="L20" class="LineNr">20 </span><span class="subxComment"># This is not a regular function, so it won't be idiomatic.</span> <span id="L21" class="LineNr">21 </span><span class="subxComment"># Registers must be properly restored.</span> <span id="L22" class="LineNr">22 </span><span class="subxComment"># Registers can be spilled, but that modifies the stack and needs to be</span> <span id="L23" class="LineNr">23 </span><span class="subxComment"># cleaned up.</span> <span id="L24" class="LineNr">24 </span> <span id="L25" class="LineNr">25 </span><span class="subxComment"># Overhead:</span> <span id="L26" class="LineNr">26 </span><span class="subxComment"># 62 + n*6 instructions to push n bytes.</span> <span id="L27" class="LineNr">27 </span><span class="subxComment"># If we just emitted code to push n zeroes, it would be:</span> <span id="L28" class="LineNr">28 </span><span class="subxComment"># 5 bytes for 4 zero bytes, so 1.25 bytes per zero. And that's not even</span> <span id="L29" class="LineNr">29 </span><span class="subxComment"># instructions.</span> <span id="L30" class="LineNr">30 </span><span class="subxComment"># But on the other hand it would destroy the instruction cache, where this</span> <span id="L31" class="LineNr">31 </span><span class="subxComment"># approach requires 15 instructions, fixed.</span> <span id="L32" class="LineNr">32 </span> <span id="L33" class="LineNr">33 </span><span class="subxComment"># n must be positive</span> <span id="L34" class="LineNr">34 </span><span class="subxFunction">push-n-zero-bytes</span>: <span class="subxComment"># n: int</span> <span id="L35" class="LineNr">35 </span><span class="Constant">$push-n-zero-bytes:prologue</span>: <span id="L36" class="LineNr">36 </span> 89/&lt;- *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L59'>Push-n-zero-bytes-ebp</a></span> 5/r32/ebp <span class="subxComment"># spill ebp without affecting stack</span> <span id="L37" class="LineNr">37 </span> 89/&lt;- %ebp 4/r32/esp <span id="L38" class="LineNr">38 </span><span class="Constant">$push-n-zero-bytes:copy-ra</span>: <span id="L39" class="LineNr">39 </span> <span class="subxComment"># -- esp = ebp</span> <span id="L40" class="LineNr">40 </span> 50/push-eax <span id="L41" class="LineNr">41 </span> <span class="subxComment"># -- esp+8 = ebp+4</span> <span id="L42" class="LineNr">42 </span> <span class="subxComment"># -- esp+4 = ebp</span> <span id="L43" class="LineNr">43 </span> 8b/-&gt; *(esp+4) 0/r32/eax <span id="L44" class="LineNr">44 </span> 2b/subtract *(ebp+4) 4/r32/esp <span id="L45" class="LineNr">45 </span> <span class="subxComment"># -- esp+4+n = ebp</span> <span id="L46" class="LineNr">46 </span> 89/&lt;- *(esp+4) 0/r32/eax <span id="L47" class="LineNr">47 </span> 58/pop-to-eax <span id="L48" class="LineNr">48 </span> <span class="subxComment"># -- esp+n = ebp</span> <span id="L49" class="LineNr">49 </span><span class="Constant">$push-n-zero-bytes:bulk-cleaning</span>: <span id="L50" class="LineNr">50 </span> 89/&lt;- *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L61'>Push-n-zero-bytes-esp</a></span> 4/r32/esp <span id="L51" class="LineNr">51 </span> 81 0/subop/add *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L61'>Push-n-zero-bytes-esp</a></span> 4/imm32 <span id="L52" class="LineNr">52 </span> 81 0/subop/add *(ebp+4) 4/imm32 <span id="L53" class="LineNr">53 </span> (<a href='120allocate.subx.html#L877'>zero-out</a> *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L61'>Push-n-zero-bytes-esp</a></span> *(ebp+4)) <span class="subxComment"># n+4</span> <span id="L54" class="LineNr">54 </span><span class="Constant">$push-n-zero-bytes:epilogue</span>: <span id="L55" class="LineNr">55 </span> 8b/-&gt; *<span class="SpecialChar"><a href='302stack_allocate.subx.html#L59'>Push-n-zero-bytes-ebp</a></span> 5/r32/ebp <span class="subxComment"># restore spill</span> <span id="L56" class="LineNr">56 </span> c3/return <span id="L57" class="LineNr">57 </span> <span id="L58" class="LineNr">58 </span>== data <span id="L59" class="LineNr">59 </span><span class="SpecialChar">Push-n-zero-bytes-ebp</span>: <span class="subxComment"># (addr int)</span> <span id="L60" class="LineNr">60 </span> 0/imm32 <span id="L61" class="LineNr">61 </span><span class="SpecialChar">Push-n-zero-bytes-esp</span>: <span class="subxComment"># (addr int)</span> <span id="L62" class="LineNr">62 </span> 0/imm32 </pre> </body> </html> <!-- vim: set foldmethod=manual : -->