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

Unified Diff: third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h

Issue 2619493003: Replace ASSERTs in platform/heap/ with DCHECKs
Patch Set: temp Created 3 years, 11 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
Index: third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h
diff --git a/third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h b/third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h
index 22c5cbd0900f82fb1bd0f71293c41dabc645cde5..44dbb5ca47d597982bc75d968e6f696351b5dc37 100644
--- a/third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h
+++ b/third_party/WebKit/Source/platform/heap/MarkingVisitorImpl.h
@@ -20,24 +20,24 @@ class MarkingVisitorImpl {
inline void markHeader(HeapObjectHeader* header,
const void* objectPointer,
TraceCallback callback) {
- ASSERT(header);
- ASSERT(objectPointer);
+ DCHECK(header);
+ DCHECK(objectPointer);
if (!toDerived()->shouldMarkObject(objectPointer))
return;
- // If you hit this ASSERT, it means that there is a dangling pointer
+ // If you hit this DCHECK, it means that there is a dangling pointer
// from a live thread heap to a dead thread heap. We must eliminate
// the dangling pointer.
- // Release builds don't have the ASSERT, but it is OK because
+ // Release builds don't have the DCHECK, but it is OK because
// release builds will crash in the following header->isMarked()
// because all the entries of the orphaned arenas are zapped.
- ASSERT(!pageFromObject(objectPointer)->orphaned());
+ DCHECK(!pageFromObject(objectPointer)->orphaned());
if (header->isMarked())
return;
- ASSERT(ThreadState::current()->isInGC());
- ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
+ DCHECK(ThreadState::current()->isInGC());
+ DCHECK(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
// A GC should only mark the objects that belong in its heap.
DCHECK(&pageFromObject(objectPointer)->arena()->getThreadState()->heap() ==
@@ -58,7 +58,7 @@ class MarkingVisitorImpl {
}
inline void registerDelayedMarkNoTracing(const void* objectPointer) {
- ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
+ DCHECK(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
toDerived()->heap().pushPostMarkingCallback(
const_cast<void*>(objectPointer), &markNoTracingCallback);
}
@@ -66,7 +66,7 @@ class MarkingVisitorImpl {
inline void registerWeakMembers(const void* closure,
const void* objectPointer,
WeakCallback callback) {
- ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
+ DCHECK(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
// We don't want to run weak processings when taking a snapshot.
if (toDerived()->getMarkingMode() == Visitor::SnapshotMarking)
return;
@@ -77,12 +77,12 @@ class MarkingVisitorImpl {
inline void registerWeakTable(const void* closure,
EphemeronCallback iterationCallback,
EphemeronCallback iterationDoneCallback) {
- ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
+ DCHECK(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
toDerived()->heap().registerWeakTable(
const_cast<void*>(closure), iterationCallback, iterationDoneCallback);
}
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
inline bool weakTableRegistered(const void* closure) {
return toDerived()->heap().weakTableRegistered(closure);
}
@@ -108,7 +108,7 @@ class MarkingVisitorImpl {
return false;
if (!toDerived()->shouldMarkObject(objectPointer))
return false;
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
if (HeapObjectHeader::fromPayload(objectPointer)->isMarked())
return false;
@@ -125,7 +125,7 @@ class MarkingVisitorImpl {
}
inline void registerWeakCellWithCallback(void** cell, WeakCallback callback) {
- ASSERT(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
+ DCHECK(toDerived()->getMarkingMode() != Visitor::WeakProcessing);
// We don't want to run weak processings when taking a snapshot.
if (toDerived()->getMarkingMode() == Visitor::SnapshotMarking)
return;

Powered by Google App Engine
This is Rietveld 408576698