summaryrefslogtreecommitdiff
path: root/src/jit/jitstd
AgeCommit message (Collapse)AuthorFilesLines
2019-06-05Small fixes around AST nodes. (#24957)Sergey Andreenko2-2/+2
* Fix MEASURE_NODE_SIZE and naming mistakes. * The additional fields were deleted in #14582 (~1.5 years ago). * Fix GT_INDEX_ADDR def. We created them as `new (this, GT_INDEX_ADDR) GenTreeIndexAddr` but used smaller `GenTreeIndex` as nessecary size. * Use LargeOpOpcode instead of GT_CALL.
2019-04-05Change the backing storage for Byref constants in ValueNumber-ing to use size_t.Brian Sullivan1-0/+6
Fixes #23538
2019-03-29A new way of tracking variables (#23373)Brian Bohe1-1/+1
* Defining VariableLiveRange class * Adding some typedefs to avoid rewriting * Defining VariableLiveDescriptor class * Initializing VariableLiveRange structures before BasicBlock code is being generated * Getting a siVarLoc for variable homes from a given LclVarDsc and stack level * Defining VariableLiveKeeper class * Reporting VariableLiveRanges on changes of variable livenesss or variable homes * Adding USING_VARIABLE_LIVE_RANGE flag to enable disable VariableLiveRange * Send VariableLiveRanges to debugger * Reporting variable homes on prolog * Wrong argument * Miss to change variable homes count before sending them to debugger * Adding dumper of VariableLiveRanges for each blocks and end of code generation * Close all open VaribleLiveRanges on last BasicBlock * Changing order of properties initialization on VariableLiveRange constructor * Type error on assignation * Rephrasing comments, moving dumps and fixing typos * Changing const VARSET_TP* for VARSET_VALARG_TP on args * Variable home was variable location in VariableLiveRange context * Rephrase and rename of VariableLiveKeeper properties * Missing some renames * Adding const where BasicBlock should not be modified * siBeginBlock and siInit have support for debug code for VariableLiveRange and siScope info * Adding USING_VARIABLE_LIVE_RANGE flags on methods definition. * Variable home -> variable location * Renaming and rephrasing names and uses of VariableLiveRange * Moving LiveRangeDumper ctor to class declation * Removing destructors Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Removing blank spaces and reordering functions inside class definition Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Miss to increment the index after refactoring * Logic for keeping the last BasicBlock end IL offset is shared between siScope and VariableLiverange for debug code * Missing to print on debug the last block VariableLiveRanges * Avoid updating VariableLiveRange when unspilling and dying at the same assembly instruction * Rephrasing #ifs and #ifdefs * Calling VariableLiveKeeper in one line * Avoid copying siVarLoc on genSetScopeInfo * Removing unused args from eeSetLVinfo * Changing VariableLiveKeeper ctor * Typo Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Updating VariableLiveDescriptor ctor Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Error on first argument Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Changing reference for pointer Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Renaming assembly offset -> native offset * removing unnecesary comments and asserts Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Update VariableLiveRange dump message Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Moving VariableLiveRanges classes inside VariableLiveKeeper * Wrong flag name * Adding documentation about how we track variables for debug info Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Adding opened issues to doc file Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Changing dump tittle Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Renaming VariableLiveKeeper property Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Update documentation Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Updating comments on flags Signed-off-by: Brian Bohe <brianbohe@gmail.com> * Setting Scope Info as default way of tracking variables for debug info Signed-off-by: Brian Bohe <brianbohe@gmail.com>
2019-03-18Fix explicit constructor calls and Remove multi-line comments (#23162)Sinan Kaya1-0/+1
* fix implicit constructor call * extern c format patch * muti-line * Remove direct constructor call * Conversion * Need paranthesis * Return value on resize * declspec(Thread) * Ignore warnings for GCC * Formatting issues * Move cast to constant
2018-06-30Pass CompAllocator by value (#15025)mikedn2-29/+16
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-03-16Do not compute the IDF for all blocks in advance (#15146)mikedn1-3/+0
InsertsPhiFunctions visits each block only once so there's no need to compute and store the IDFs for all blocks in advance. The IDF of a given block can be computed when the block is visited and discarded after that. This way a single BlkVector can be reused for all blocks.
2018-01-05Refactor minRegCount and eliminate autoCarol Eidt1-0/+14
When building RefPositions in the TreeNodeInfoInit methods, it is very complex and messy to have the setting of the (debug-only) `minRegCandidateCount` spread all over. Instead, set them for all the RefPositions for a given node after they have been created. This required the ability to create an iterator marking the end of the list, prior to creating the new ones. In the process, eliminated the use of auto from lsra.cpp in the interest of strong typing, as well as avoiding the confusion of having things with `RefPosition` in their name that are actually iterators. These changes originally caused failures with JitStressRegs because `getKillSetForNode()` had side effects - generating Kill `RefPosition`s for `MOD` & `DIV`. This is not actually necessary, and causes problems when the debug-only stress code was calling it *after* all the `RefPosition`s had been created. Also, this had the weird (existing) effect that duplicate kill `RefPosition`s were being generated in the stress case!
2017-12-20fix template method that nobody calls. (#15584)Sergey Andreenko1-2/+2
2017-10-15Avoid using IAllocator in jitstdMike Danes1-24/+6
2017-06-28Fix remove in list (#12497)Kyungwoo Lee1-2/+10
`remove` uses `erase` to delete the entry in list. Since `erase` returns the next iterator, the iterator shouldn't be increased when the entry is found and deleted.
2017-06-07Do unsigned magic divisionMike Danes1-0/+27
2017-03-13Build Linux altjit for x86 and amd64 (#10120)Bruce Forstall1-2/+3
Enable Windows hosted, Linux target amd64 altjit With this change, we build a JIT that runs on Windows amd64 and targets Linux amd64, as an altjit named linuxnonjit.dll. This is useful for debugging, or generating asm code or diffs. You can even easily create Windows/non-Windows asm diffs (either to compare the asm, or compare the generated code size). For this to work, the JIT-EE interface method getSystemVAmd64PassStructInRegisterDescriptor() was changed to always be built in, by defining `FEATURE_UNIX_AMD64_STRUCT_PASSING_ITF` in all AMD64 builds. The `_ITF` suffix indicates that this is functionality specific to implementing the JIT-EE interface contract. There were many places in the VM that used this interchangeably with `FEATURE_UNIX_AMD64_STRUCT_PASSING`. Now, `FEATURE_UNIX_AMD64_STRUCT_PASSING` means code in the VM needed to implement this feature, but not required to implement the JIT-EE interface contract. In particular, MethodTables compute and cache the "eightbyte" info of structs when loading a type. This is not done when only `FEATURE_UNIX_AMD64_STRUCT_PASSING_ITF` is set, to avoid altering MethodTable behavior on non-Unix AMD64 builds. Instead, if `getSystemVAmd64PassStructInRegisterDescriptor()` is called on a non-Unix build (by the altjit), the `ClassifyEightBytes()` function is called, and nothing is cached. Hopefully (though it was hard for me to guarantee by observation), calling `ClassifyEightBytes()` does not have any side effects on MethodTables. It doesn't really matter, since if called for altjit, we don't care too much about running. The previously used `PLATFORM_UNIX` define is now insufficient. I introduced the `#define` macros `_HOST_UNIX_` to indicate the JIT being built will run on Unix, and `_TARGET_UNIX_` to indicate the JIT is generating code targeting Unix. Some things were converted to use the `UNIX_AMD64_ABI` define, which makes more sense.
2016-08-11Reformat jit sources with clang-tidy and formatMichelle McDaniel3-14/+14
This change is the result of running clang-tidy and clang-format on jit sources.
2016-03-13Cleanup emplace/insert implementationMike Danes1-73/+43
2016-03-12Avoid Interval and RefPosition unnecessary initialization and copyingMike Danes3-0/+112
RefPosition() builds a temporary object and initializes it with memset. push_back copies the temporary object to the list node. memset is called again to zero out the newly created RefPosition object. Add emplace methods to jitstd::list to avoid copying. Drop the redundant memset call.
2016-03-08Use jitstd::list in the LSRA.Pat Gavlin1-2/+28
This removes the only usage of ArrayList in the JIT.
2016-03-02Merge pull request #1668 from Dmitry-Me/assignmentOpReturningUnsuitableTypePat Gavlin1-1/+2
Impossible implicit downcast in assignment operator
2016-01-27Update license headersdotnet-bot18-72/+54
2015-10-02Impossible implicit downcast in assignment operatorDmitry-Me1-1/+2
2015-03-26Fix warnings in the jitter codeJan Vorlicek3-10/+10
This change fixes some of the warnings in the jitter code on Linux. With this change combined with an upcoming change in the rest of the codebase, 16 warning disabling options can be removed. The issues in the jitter were: 1) Incorrect typedefs for const_reference and const_pointer (the const was ignored) 2) Member initiazalization order in class constructor didn't correspond to the member order in some classes 3) Objects with vtables were copied via memcpy. While this is intentional, cast of the pointers to void* is required to silence clang warning 4) Comparing values of different enums - there are cases of two enums containing the same values. 5) Casting int to pointer - the cast was legal (forming a handle), adding cast to size_t in between used to fix the warning 6) "static struct" - removed the static keyword 7) Missing return value in methods with _ASSERTE 8) Class name classifier on methods in the .h 9) Specialized template member functions need to be defined out of the class
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot21-0/+4715
[tfs-changeset: 1407945]