Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1332)

Unified Diff: third_party/WebKit/Source/wtf/Vector.h

Issue 1845923005: CL for perf tryjob on android Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/TypedArrayBase.h ('k') | third_party/WebKit/Source/wtf/WTF.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/Vector.h
diff --git a/third_party/WebKit/Source/wtf/Vector.h b/third_party/WebKit/Source/wtf/Vector.h
index f65d9a69f86154dbc4d32a65ac1ceb21c53e900f..c6c0f98f0ad3d7582a7326211121949f43cfe391 100644
--- a/third_party/WebKit/Source/wtf/Vector.h
+++ b/third_party/WebKit/Source/wtf/Vector.h
@@ -841,12 +841,12 @@ public:
T& at(size_t i)
{
- CHECK_LT(i, size());
+ RELEASE_ASSERT(i < size());
return Base::buffer()[i];
}
const T& at(size_t i) const
{
- CHECK_LT(i, size());
+ RELEASE_ASSERT(i < size());
return Base::buffer()[i];
}
@@ -1125,7 +1125,7 @@ void Vector<T, inlineCapacity, Allocator>::expandCapacity(size_t newMinCapacity)
if (INLINE_CAPACITY) {
expandedCapacity *= 2;
// Check for integer overflow, which could happen in the 32-bit build.
- CHECK_GT(expandedCapacity, oldCapacity);
+ RELEASE_ASSERT(expandedCapacity > oldCapacity);
} else {
// This cannot integer overflow.
// On 64-bit, the "expanded" integer is 32-bit, and any encroachment
@@ -1291,7 +1291,7 @@ void Vector<T, inlineCapacity, Allocator>::append(const U* data, size_t dataSize
data = expandCapacity(newSize, data);
ASSERT(begin());
}
- CHECK_GE(newSize, m_size);
+ RELEASE_ASSERT(newSize >= m_size);
T* dest = end();
ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, newSize);
VectorCopier<VectorTraits<T>::canCopyWithMemcpy, T>::uninitializedCopy(data, &data[dataSize], dest);
@@ -1358,13 +1358,13 @@ template <typename U>
void Vector<T, inlineCapacity, Allocator>::insert(size_t position, const U* data, size_t dataSize)
{
ASSERT(Allocator::isAllocationAllowed());
- CHECK_LE(position, size());
+ RELEASE_ASSERT(position <= size());
size_t newSize = m_size + dataSize;
if (newSize > capacity()) {
data = expandCapacity(newSize, data);
ASSERT(begin());
}
- CHECK_GE(newSize, m_size);
+ RELEASE_ASSERT(newSize >= m_size);
ANNOTATE_CHANGE_SIZE(begin(), capacity(), m_size, newSize);
T* spot = begin() + position;
TypeOperations::moveOverlapping(spot, end(), spot + dataSize);
@@ -1377,7 +1377,7 @@ template <typename U>
inline void Vector<T, inlineCapacity, Allocator>::insert(size_t position, U&& val)
{
ASSERT(Allocator::isAllocationAllowed());
- CHECK_LE(position, size());
+ RELEASE_ASSERT(position <= size());
typename std::remove_reference<U>::type* data = &val;
if (size() == capacity()) {
data = expandCapacity(size() + 1, data);
@@ -1421,7 +1421,7 @@ inline void Vector<T, inlineCapacity, Allocator>::prependVector(const Vector<U,
template <typename T, size_t inlineCapacity, typename Allocator>
inline void Vector<T, inlineCapacity, Allocator>::remove(size_t position)
{
- CHECK_LT(position, size());
+ RELEASE_ASSERT(position < size());
T* spot = begin() + position;
spot->~T();
TypeOperations::moveOverlapping(spot + 1, end(), spot);
@@ -1436,7 +1436,7 @@ inline void Vector<T, inlineCapacity, Allocator>::remove(size_t position, size_t
ASSERT_WITH_SECURITY_IMPLICATION(position <= size());
if (!length)
return;
- CHECK_LE(position + length, size());
+ RELEASE_ASSERT(position + length <= size());
T* beginSpot = begin() + position;
T* endSpot = beginSpot + length;
TypeOperations::destruct(beginSpot, endSpot);
« no previous file with comments | « third_party/WebKit/Source/wtf/TypedArrayBase.h ('k') | third_party/WebKit/Source/wtf/WTF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698