Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: src/heap/objects-visiting-inl.h

Issue 1158423002: Treat links that organize weak objects weakly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698