summaryrefslogtreecommitdiff
path: root/src/jit/arraystack.h
AgeCommit message (Collapse)AuthorFilesLines
2019-01-08Use `saveNext` unwind opcode on arm64. (#21683)Sergey Andreenko1-1/+1
* Use `saveNext` opcode on arm64. * Support using of `save_next` on int/float border. * Delete the extra requirement that an epilog sequences can't start from `save_next`. * response feedback
2018-12-22Fix ArrayStack's call to default constructor for <T>. (#21624)Sergey Andreenko1-32/+19
* Add ArrayStack::Empty * Add ArrayStack::BottomRef * Delete unused `ReverseTop`. * do not use default constructor.
2018-06-30Pass CompAllocator by value (#15025)mikedn1-9/+7
Passing CompAllocator objects by value is advantageous because it no longer needs to be dynamically allocated and cached. CompAllocator instances can now be freely created, copied and stored, which makes adding new CompMemKind values easier. Together with other cleanup this also improves memory allocation performance by removing some extra levels of indirection that were previously required - jitstd::allocator had a pointer to CompAllocator, CompAllocator had a pointer to Compiler and Compiler finally had a pointer to ArenaAllocator. Without MEASURE_MEM_ALLOC enabled, both jitstd::allocator and CompAllocator now just contain a pointer to ArenaAllocator. When MEASURE_MEM_ALLOC is enabled CompAllocator also contains a pointer but to a MemStatsAllocator object that holds the relevant memory kind. This way CompAllocator is always pointer sized so that enabling MEASURE_MEM_ALLOC does not result in increased memory usage due to objects that store a CompAllocator instance. In order to implement this, 2 additional signficant changes have been made: * MemStats has been moved to ArenaAllocator, it's after all the allocator's job to maintain statistics. This also fixes some issues related to memory statistics, such as not tracking the memory allocated by the inlinee compiler (since that one used its own MemStats instance). * Extract the arena page pooling logic out of the allocator. It doesn't make sense to pool an allocator, it has very little state that can actually be reused and everyting else (including MemStats) needs to be reset on reuse. What really needs to be pooled is just a page of memory. Since this was touching allocation code the opportunity has been used to perform additional cleanup: * Remove unnecessary LSRA ListElementAllocator * Remove compGetMem and compGetMemArray * Make CompAllocator and HostAllocator more like the std allocator * Update HashTable to use CompAllocator * Update ArrayStack to use CompAllocator * Move CompAllocator & friends to alloc.h
2018-05-24Improve SSA topological sort (#15200)mikedn1-0/+12
* Simplify block successor iterators Construction of an end AllSuccessorIter requires the number of block successors. This can be avoided by keeping track of the number of remaining successors so that the end iterator is simply "0 remaining successors". Remove StartAllSuccs & co. These functions don't do anything useful. Since AllSuccessorIter and EHSuccessorIter now have similar constructors the "collection" classes AllSuccs and EHSuccs can be replaced by a single template class. * Split out block successor iterator logic The AllSuccessorIterator iterator is pretty large - 64 bytes on 64 bit hosts. When used as local variables that's not much of a problem but if they end up stored in containers then a lot of space is wasted. AllSuccessorIter contains a pointer to the compiler object and a pointer to the block whose successors it iterates over. And then it also contains an EHSuccessorIter that contains the same 2 pointers. In scenarios such as the one in SsaBuilder::TopologicalSort the compiler pointer need not be stored and the block needs to be stored only once and be made accessible so a separate block stack isn't needed. This change splits out the successor iterating logic into separate "position" classes that receieve the compiler and block via function parameters. * Improve TopologicalSort memory usage
2016-08-11Reformat jit sources with clang-tidy and formatMichelle McDaniel1-25/+26
This change is the result of running clang-tidy and clang-format on jit sources.
2016-06-23Support for updating a nonStandard arg in-place the ArrayStack when it is ↵Brian Sullivan1-0/+7
modified by fgMorphTree
2016-02-16Avoid unnecessary copies of AllSuccessorIter, LocationInfo and VNDefFunc2ArgMike Danes1-0/+6
ArrayStack<T>::Top() returns a copy rather than a reference like typical C++ containers do. For large Ts like AllSuccessorIterator and LocationInfo this results in a lot of code bloat and unncessary copying. Add a T& TopRef() function to avoid such copying.
2016-01-27Update license headersdotnet-bot1-4/+3
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+133
[tfs-changeset: 1407945]