| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include "src/heap/objects-visiting.h" | 5 #include "src/heap/objects-visiting.h" |
| 6 | 6 |
| 7 #include "src/heap/mark-compact-inl.h" | 7 #include "src/heap/mark-compact-inl.h" |
| 8 #include "src/heap/objects-visiting-inl.h" | 8 #include "src/heap/objects-visiting-inl.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Subsequent elements in the list. | 205 // Subsequent elements in the list. |
| 206 DCHECK(tail != NULL); | 206 DCHECK(tail != NULL); |
| 207 WeakListVisitor<T>::SetWeakNext(tail, retained); | 207 WeakListVisitor<T>::SetWeakNext(tail, retained); |
| 208 if (record_slots) { | 208 if (record_slots) { |
| 209 Object** next_slot = | 209 Object** next_slot = |
| 210 HeapObject::RawField(tail, WeakListVisitor<T>::WeakNextOffset()); | 210 HeapObject::RawField(tail, WeakListVisitor<T>::WeakNextOffset()); |
| 211 collector->RecordSlot(tail, next_slot, retained); | 211 collector->RecordSlot(tail, next_slot, retained); |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 // Retained object is new tail. | 214 // Retained object is new tail. |
| 215 DCHECK(!retained->IsUndefined()); | 215 DCHECK(!retained->IsUndefined(heap->isolate())); |
| 216 candidate = reinterpret_cast<T*>(retained); | 216 candidate = reinterpret_cast<T*>(retained); |
| 217 tail = candidate; | 217 tail = candidate; |
| 218 | 218 |
| 219 // tail is a live object, visit it. | 219 // tail is a live object, visit it. |
| 220 WeakListVisitor<T>::VisitLiveObject(heap, tail, retainer); | 220 WeakListVisitor<T>::VisitLiveObject(heap, tail, retainer); |
| 221 | 221 |
| 222 } else { | 222 } else { |
| 223 WeakListVisitor<T>::VisitPhantomObject(heap, candidate); | 223 WeakListVisitor<T>::VisitPhantomObject(heap, candidate); |
| 224 } | 224 } |
| 225 | 225 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 }; | 356 }; |
| 357 | 357 |
| 358 | 358 |
| 359 template Object* VisitWeakList<Context>(Heap* heap, Object* list, | 359 template Object* VisitWeakList<Context>(Heap* heap, Object* list, |
| 360 WeakObjectRetainer* retainer); | 360 WeakObjectRetainer* retainer); |
| 361 | 361 |
| 362 template Object* VisitWeakList<AllocationSite>(Heap* heap, Object* list, | 362 template Object* VisitWeakList<AllocationSite>(Heap* heap, Object* list, |
| 363 WeakObjectRetainer* retainer); | 363 WeakObjectRetainer* retainer); |
| 364 } // namespace internal | 364 } // namespace internal |
| 365 } // namespace v8 | 365 } // namespace v8 |
| OLD | NEW |