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

Unified Diff: src/heap/mark-compact.cc

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years 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: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 27d257980f281c9067d264f8e239bda5d198a481..33a8ae8b7e6b5518c46f461b428faa921af0d6e0 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -37,7 +37,7 @@ const char* Marking::kImpossibleBitPattern = "01";
MarkCompactCollector::MarkCompactCollector(Heap* heap)
: // NOLINT
-#ifdef DEBUG
+#if DCHECK_IS_ON
state_(IDLE),
#endif
reduce_memory_footprint_(false),
@@ -543,7 +543,7 @@ void Marking::TransferMark(Address old_start, Address new_start) {
MarkBit new_mark_bit = MarkBitFrom(new_start);
MarkBit old_mark_bit = MarkBitFrom(old_start);
-#ifdef DEBUG
+#if DCHECK_IS_ON
ObjectColor old_color = Color(old_mark_bit);
#endif
@@ -561,7 +561,7 @@ void Marking::TransferMark(Address old_start, Address new_start) {
heap_->incremental_marking()->RestartIfNotMarking();
}
-#ifdef DEBUG
+#if DCHECK_IS_ON
ObjectColor new_color = Color(new_mark_bit);
DCHECK(new_color == old_color);
#endif
@@ -815,7 +815,7 @@ void MarkCompactCollector::AbortCompaction() {
void MarkCompactCollector::Prepare() {
was_marked_incrementally_ = heap()->incremental_marking()->IsMarking();
-#ifdef DEBUG
+#if DCHECK_IS_ON
DCHECK(state_ == IDLE);
state_ = PREPARE_GC;
#endif
@@ -858,7 +858,7 @@ void MarkCompactCollector::Prepare() {
void MarkCompactCollector::Finish() {
-#ifdef DEBUG
+#if DCHECK_IS_ON
DCHECK(state_ == SWEEP_SPACES || state_ == RELOCATE_OBJECTS);
state_ = IDLE;
#endif
@@ -1298,7 +1298,7 @@ class MarkCompactMarkingVisitor
// Visit an unmarked object.
INLINE(static void VisitUnmarkedObject(MarkCompactCollector* collector,
HeapObject* obj)) {
-#ifdef DEBUG
+#if DCHECK_IS_ON
Jakob Kummerow 2014/12/03 10:53:53 just drop this #if
DCHECK(collector->heap()->Contains(obj));
DCHECK(!collector->heap()->mark_compact_collector()->IsMarked(obj));
#endif
@@ -2180,7 +2180,7 @@ void MarkCompactCollector::MarkLiveObjects() {
InitializeMarkingDeque();
}
-#ifdef DEBUG
+#if DCHECK_IS_ON
DCHECK(state_ == PREPARE_GC);
state_ = MARK_LIVE_OBJECTS;
#endif
@@ -4155,7 +4155,7 @@ void MarkCompactCollector::SweepSpaces() {
start_time = base::OS::TimeCurrentMillis();
}
-#ifdef DEBUG
+#if DCHECK_IS_ON
state_ = SWEEP_SPACES;
#endif
MoveEvacuationCandidatesToEndOfPagesList();

Powered by Google App Engine
This is Rietveld 408576698