Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 597a00cd6c084b6e0c7ddc066a1fef7796671108..3695b2fff001aef9ca5bb97349e477e889ab6aac 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2036,7 +2036,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)); |
} |