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

Unified Diff: Source/platform/heap/Heap.h

Issue 1211243006: Oilpan: Replace checkHeader() with ASSERT(checkHeader()) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 974a86c4be59b5a4d6e7261f2fbf4825e308cad9..2e9047d786f19b77e86346b2f972cd4097f0a853 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -184,8 +184,8 @@ public:
size_t payloadSize();
Address payloadEnd();
- void checkHeader() const;
#if ENABLE(ASSERT)
+ bool checkHeader() const;
// Zap magic number with a new magic number that means there was once an
// object allocated here, but it was freed because nobody marked it during
// GC.
@@ -1244,12 +1244,13 @@ size_t HeapObjectHeader::size() const
return result;
}
+#if ENABLE(ASSERT)
NO_SANITIZE_ADDRESS inline
-void HeapObjectHeader::checkHeader() const
+bool HeapObjectHeader::checkHeader() const
{
- ASSERT(!pageFromObject(this)->orphaned());
- ASSERT(m_magic == magic);
+ return !pageFromObject(this)->orphaned() && m_magic == magic;
}
+#endif
inline Address HeapObjectHeader::payload()
{
@@ -1277,21 +1278,21 @@ inline HeapObjectHeader* HeapObjectHeader::fromPayload(const void* payload)
{
Address addr = reinterpret_cast<Address>(const_cast<void*>(payload));
HeapObjectHeader* header = reinterpret_cast<HeapObjectHeader*>(addr - sizeof(HeapObjectHeader));
- header->checkHeader();
+ ASSERT(header->checkHeader());
return header;
}
NO_SANITIZE_ADDRESS inline
bool HeapObjectHeader::isMarked() const
{
- checkHeader();
+ ASSERT(checkHeader());
return m_encoded & headerMarkBitMask;
}
NO_SANITIZE_ADDRESS inline
void HeapObjectHeader::mark()
{
- checkHeader();
+ ASSERT(checkHeader());
ASSERT(!isMarked());
m_encoded = m_encoded | headerMarkBitMask;
}
@@ -1299,7 +1300,7 @@ void HeapObjectHeader::mark()
NO_SANITIZE_ADDRESS inline
void HeapObjectHeader::unmark()
{
- checkHeader();
+ ASSERT(checkHeader());
ASSERT(isMarked());
m_encoded &= ~headerMarkBitMask;
}
@@ -1307,14 +1308,14 @@ void HeapObjectHeader::unmark()
NO_SANITIZE_ADDRESS inline
bool HeapObjectHeader::isDead() const
{
- checkHeader();
+ ASSERT(checkHeader());
return m_encoded & headerDeadBitMask;
}
NO_SANITIZE_ADDRESS inline
void HeapObjectHeader::markDead()
{
- checkHeader();
+ ASSERT(checkHeader());
ASSERT(!isMarked());
m_encoded |= headerDeadBitMask;
}
« no previous file with comments | « Source/platform/heap/Handle.h ('k') | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698