Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index a5b46a454a15b948d9cc649a125243d6cf1604aa..26adbc12886480112a3173afe4864e4ec705af27 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1930,13 +1930,14 @@ void PropertyCell::set_type_raw(Object* val, WriteBarrierMode ignored) { |
} |
-HeapObject* WeakCell::value() const { |
+Object* WeakCell::value() const { |
return HeapObject::cast(READ_FIELD(this, kValueOffset)); |
} |
-void WeakCell::clear(HeapObject* undefined) { |
- WRITE_FIELD(this, kValueOffset, undefined); |
+void WeakCell::clear() { |
+ DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); |
+ WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); |
} |
@@ -1946,6 +1947,9 @@ void WeakCell::initialize(HeapObject* val) { |
} |
+bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } |
+ |
+ |
Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } |