summaryrefslogtreecommitdiff
path: root/src/jit/assertionprop.cpp
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2017-08-04 14:39:05 -0700
committerBrian Sullivan <briansul@microsoft.com>2017-08-07 11:04:09 -0700
commit44d85b0bcb605d872314e78a22739ce5b567e678 (patch)
tree39805e2c750bcd39e493655bdca7c621c57ada8a /src/jit/assertionprop.cpp
parenta9516dacd742ccaeae2820b89ad313a53d22d917 (diff)
downloadcoreclr-44d85b0bcb605d872314e78a22739ce5b567e678.tar.gz
coreclr-44d85b0bcb605d872314e78a22739ce5b567e678.tar.bz2
coreclr-44d85b0bcb605d872314e78a22739ce5b567e678.zip
Removed the legacy JIT32 assert regarding 4-byte alignment inArenaAllocator::allocateMemory
Immediately after this assert we roundUp to an pointer size allocation amount. Stopped using two implementation of ArenaAllocator::allocateMemory Instead we add ifdef DEBUG parts to the common version Move the implementation of ArenaAllocator::allocateMemory to the header file Fixed a couple of allocations in assertionprop to use CMF_AssertionProp so that we correctly attribute which phase uses the memory being allocated. Added range check for the array writes in Compiler::optMapComplementary Removed the AlignUp to 4-byte in operator new and new[] in compiler.hpp
Diffstat (limited to 'src/jit/assertionprop.cpp')
-rw-r--r--src/jit/assertionprop.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index bcdae634e0..9b7bedd87b 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -524,7 +524,7 @@ ASSERT_TP& Compiler::GetAssertionDep(unsigned lclNum)
void Compiler::optAssertionTraitsInit(AssertionIndex assertionCount)
{
- apTraits = new (getAllocator()) BitVecTraits(assertionCount, this);
+ apTraits = new (this, CMK_AssertionProp) BitVecTraits(assertionCount, this);
apFull = BitVecOps::MakeFull(apTraits);
}
@@ -547,9 +547,9 @@ void Compiler::optAssertionInit(bool isLocalProp)
optMaxAssertionCount = countFunc[isLocalProp ? lowerBound : min(upperBound, codeSize)];
optLocalAssertionProp = isLocalProp;
- optAssertionTabPrivate = new (getAllocator()) AssertionDsc[optMaxAssertionCount];
+ optAssertionTabPrivate = new (this, CMK_AssertionProp) AssertionDsc[optMaxAssertionCount];
optComplementaryAssertionMap =
- new (getAllocator()) AssertionIndex[optMaxAssertionCount](); // zero-inited (NO_ASSERTION_INDEX.)
+ new (this, CMK_AssertionProp) AssertionIndex[optMaxAssertionCount + 1](); // zero-inited (NO_ASSERTION_INDEX)
assert(NO_ASSERTION_INDEX == 0);
if (!isLocalProp)
@@ -559,7 +559,7 @@ void Compiler::optAssertionInit(bool isLocalProp)
if (optAssertionDep == nullptr)
{
- optAssertionDep = new (getAllocator()) ExpandArray<ASSERT_TP>(getAllocator(), max(1, lvaCount));
+ optAssertionDep = new (this, CMK_AssertionProp) ExpandArray<ASSERT_TP>(getAllocator(), max(1, lvaCount));
}
optAssertionTraitsInit(optMaxAssertionCount);
@@ -2150,6 +2150,10 @@ void Compiler::optMapComplementary(AssertionIndex assertionIndex, AssertionIndex
{
return;
}
+
+ assert(assertionIndex <= optMaxAssertionCount);
+ assert(index <= optMaxAssertionCount);
+
optComplementaryAssertionMap[assertionIndex] = index;
optComplementaryAssertionMap[index] = assertionIndex;
}