Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 4fde394864d57c25320473bfb6cbd9dd021e9cba..73fcaf0444b284e9538c26e3f2156365e72b9d6b 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1917,7 +1917,13 @@ void WeakCell::clear() { |
void WeakCell::initialize(HeapObject* val) { |
WRITE_FIELD(this, kValueOffset, val); |
- WRITE_BARRIER(GetHeap(), this, kValueOffset, val); |
+ Heap* heap = GetHeap(); |
+ // We just have to execute the generational barrier here because we never |
+ // mark through a weak cell and collect evacuation candidates when we process |
+ // all weak cells. |
+ if (heap->InNewSpace(val)) { |
+ heap->RecordWrite(address(), kValueOffset); |
+ } |
} |