OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_VISITING_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
7 | 7 |
8 #include "src/heap/objects-visiting.h" | 8 #include "src/heap/objects-visiting.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset), | 322 HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset), |
323 HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset)); | 323 HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset)); |
324 } | 324 } |
325 | 325 |
326 | 326 |
327 template <typename StaticVisitor> | 327 template <typename StaticVisitor> |
328 void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map, | 328 void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map, |
329 HeapObject* object) { | 329 HeapObject* object) { |
330 Heap* heap = map->GetHeap(); | 330 Heap* heap = map->GetHeap(); |
331 WeakCell* weak_cell = reinterpret_cast<WeakCell*>(object); | 331 WeakCell* weak_cell = reinterpret_cast<WeakCell*>(object); |
332 Object* the_hole = heap->the_hole_value(); | |
333 // Enqueue weak cell in linked list of encountered weak collections. | 332 // Enqueue weak cell in linked list of encountered weak collections. |
334 // We can ignore weak cells with cleared values because they will always | 333 // We can ignore weak cells with cleared values because they will always |
335 // contain smi zero. | 334 // contain smi zero. |
336 if (weak_cell->next() == the_hole && !weak_cell->cleared()) { | 335 if (weak_cell->next_cleared() && !weak_cell->cleared()) { |
337 weak_cell->set_next(heap->encountered_weak_cells(), | 336 weak_cell->set_next(heap->encountered_weak_cells(), |
338 UPDATE_WEAK_WRITE_BARRIER); | 337 UPDATE_WEAK_WRITE_BARRIER); |
339 heap->set_encountered_weak_cells(weak_cell); | 338 heap->set_encountered_weak_cells(weak_cell); |
340 } | 339 } |
341 } | 340 } |
342 | 341 |
343 | 342 |
344 template <typename StaticVisitor> | 343 template <typename StaticVisitor> |
345 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( | 344 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( |
346 Map* map, HeapObject* object) { | 345 Map* map, HeapObject* object) { |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 | 835 |
837 RelocIterator it(this, mode_mask); | 836 RelocIterator it(this, mode_mask); |
838 for (; !it.done(); it.next()) { | 837 for (; !it.done(); it.next()) { |
839 it.rinfo()->template Visit<StaticVisitor>(heap); | 838 it.rinfo()->template Visit<StaticVisitor>(heap); |
840 } | 839 } |
841 } | 840 } |
842 } | 841 } |
843 } // namespace v8::internal | 842 } // namespace v8::internal |
844 | 843 |
845 #endif // V8_OBJECTS_VISITING_INL_H_ | 844 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |