Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index e1e3e48f9b5c1e847a6b650ea1ecdd88118cef8d..ae7f1c864e667436c37282e485eaefe39d4ca9d2 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)); |
} |