diff options
author | Mike Danes <onemihaid@hotmail.com> | 2017-11-13 22:36:50 +0200 |
---|---|---|
committer | Mike Danes <onemihaid@hotmail.com> | 2018-07-19 07:29:44 +0300 |
commit | 72a1d0ee7c9f5989edc9f449df24b5b87a5844ce (patch) | |
tree | d0ee59011a0f538a9a129289c7285fadc4d51fd0 /src/jit/compiler.hpp | |
parent | 624f72d55a92e49aef3c3cd6e69150fa3b085fac (diff) | |
download | coreclr-72a1d0ee7c9f5989edc9f449df24b5b87a5844ce.tar.gz coreclr-72a1d0ee7c9f5989edc9f449df24b5b87a5844ce.tar.bz2 coreclr-72a1d0ee7c9f5989edc9f449df24b5b87a5844ce.zip |
Eliminate duplicate SSA number bookkeeping
During SSA construction SsaRenameState keeps a definition count for each variable in an array. But each variable has a lvPerSsaData array that does almost the same thing, count the definitions. "Almost" because lvPerSsaData is a JitExpandArray that tracks only the array size and not the number of elements actually stored in the array.
Replace JitExpandArray with purposely designed "array" that is in charge with allocating new SSA numbers and handles their intricacies - RESERVED_SSA_NUM, UNINIT_SSA_NUM and FIRST_SSA_NUM.
This also allows the removal of the allocator from the array. Allocating new SSA numbers happens only during SSA construction and it's reasonable to pass the allocator to AllocSsaNum rather than increasing the size of PerSsaArray and LclVarDsc.
Diffstat (limited to 'src/jit/compiler.hpp')
-rw-r--r-- | src/jit/compiler.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp index 270a5932df..a43b35ae3c 100644 --- a/src/jit/compiler.hpp +++ b/src/jit/compiler.hpp @@ -1670,7 +1670,7 @@ inline unsigned Compiler::lvaGrabTemp(bool shortLifetime DEBUGARG(const char* re for (unsigned i = lvaCount; i < newLvaTableCnt; i++) { - new (&newLvaTable[i], jitstd::placement_t()) LclVarDsc(this); // call the constructor. + new (&newLvaTable[i], jitstd::placement_t()) LclVarDsc(); // call the constructor. } #ifdef DEBUG @@ -1743,7 +1743,7 @@ inline unsigned Compiler::lvaGrabTemps(unsigned cnt DEBUGARG(const char* reason) memset(newLvaTable + lvaCount, 0, (newLvaTableCnt - lvaCount) * sizeof(*lvaTable)); for (unsigned i = lvaCount; i < newLvaTableCnt; i++) { - new (&newLvaTable[i], jitstd::placement_t()) LclVarDsc(this); // call the constructor. + new (&newLvaTable[i], jitstd::placement_t()) LclVarDsc(); // call the constructor. } #ifdef DEBUG |