| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 template <typename StaticVisitor> | 325 template <typename StaticVisitor> |
| 326 void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map, | 326 void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map, |
| 327 HeapObject* object) { | 327 HeapObject* object) { |
| 328 Heap* heap = map->GetHeap(); | 328 Heap* heap = map->GetHeap(); |
| 329 WeakCell* weak_cell = reinterpret_cast<WeakCell*>(object); | 329 WeakCell* weak_cell = reinterpret_cast<WeakCell*>(object); |
| 330 Object* undefined = heap->undefined_value(); | 330 Object* undefined = heap->undefined_value(); |
| 331 // Enqueue weak cell in linked list of encountered weak collections. | 331 // Enqueue weak cell in linked list of encountered weak collections. |
| 332 // We can ignore weak cells with cleared values because they will always | 332 // We can ignore weak cells with cleared values because they will always |
| 333 // contain smi zero. | 333 // contain smi zero. |
| 334 if (weak_cell->next() == undefined && !weak_cell->cleared()) { | 334 if (weak_cell->next() == undefined && !weak_cell->cleared()) { |
| 335 weak_cell->set_next(heap->encountered_weak_cells()); | 335 weak_cell->set_next(heap->encountered_weak_cells(), |
| 336 UPDATE_WEAK_WRITE_BARRIER); |
| 336 heap->set_encountered_weak_cells(weak_cell); | 337 heap->set_encountered_weak_cells(weak_cell); |
| 337 } | 338 } |
| 338 } | 339 } |
| 339 | 340 |
| 340 | 341 |
| 341 template <typename StaticVisitor> | 342 template <typename StaticVisitor> |
| 342 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( | 343 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( |
| 343 Map* map, HeapObject* object) { | 344 Map* map, HeapObject* object) { |
| 344 Heap* heap = map->GetHeap(); | 345 Heap* heap = map->GetHeap(); |
| 345 | 346 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 | 869 |
| 869 RelocIterator it(this, mode_mask); | 870 RelocIterator it(this, mode_mask); |
| 870 for (; !it.done(); it.next()) { | 871 for (; !it.done(); it.next()) { |
| 871 it.rinfo()->template Visit<StaticVisitor>(heap); | 872 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 872 } | 873 } |
| 873 } | 874 } |
| 874 } | 875 } |
| 875 } // namespace v8::internal | 876 } // namespace v8::internal |
| 876 | 877 |
| 877 #endif // V8_OBJECTS_VISITING_INL_H_ | 878 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |