Index: src/heap/objects-visiting-inl.h |
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
index dcf8a9b02607508d75169d4740ab2321d27a309a..09b38237711886ea0773e2e0a995b6d9a79653d9 100644 |
--- a/src/heap/objects-visiting-inl.h |
+++ b/src/heap/objects-visiting-inl.h |
@@ -358,9 +358,9 @@ void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map, |
WeakCell* weak_cell = reinterpret_cast<WeakCell*>(object); |
Object* undefined = heap->undefined_value(); |
// Enqueue weak cell in linked list of encountered weak collections. |
- // We can ignore weak cells with cleared values because they will always point |
- // to the undefined_value. |
- if (weak_cell->next() == undefined && weak_cell->value() != undefined) { |
+ // We can ignore weak cells with cleared values because they will always |
+ // contain smi zero. |
+ if (weak_cell->next() == undefined && !weak_cell->cleared()) { |
Erik Corry Chromium.org
2014/10/20 08:00:18
Perhaps this should just check for Sminess instead
ulan
2014/10/20 12:30:18
Since the initialization function of the weak cell
|
weak_cell->set_next(heap->encountered_weak_cells()); |
heap->set_encountered_weak_cells(weak_cell); |
} |