Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 13fb9e2dfd44ec7b1121ac11d28fe9effee93c06..cbb19531b5bb1127f9e742ace0c4b8ed07422e56 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2029,7 +2029,10 @@ Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); } |
void WeakCell::clear() { |
- DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); |
+ // Either the garbage collector is clearing the cell or we are simply |
+ // initializing the root empty weak cell. |
+ DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT || |
+ this == GetHeap()->empty_weak_cell()); |
WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); |
} |