| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/ic-inl.h" | 7 #include "src/ic-inl.h" |
| 8 #include "src/objects-visiting.h" | 8 #include "src/objects-visiting.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 while (list != undefined) { | 211 while (list != undefined) { |
| 212 // Check whether to keep the candidate in the list. | 212 // Check whether to keep the candidate in the list. |
| 213 T* candidate = reinterpret_cast<T*>(list); | 213 T* candidate = reinterpret_cast<T*>(list); |
| 214 Object* retained = retainer->RetainAs(list); | 214 Object* retained = retainer->RetainAs(list); |
| 215 if (retained != NULL) { | 215 if (retained != NULL) { |
| 216 if (head == undefined) { | 216 if (head == undefined) { |
| 217 // First element in the list. | 217 // First element in the list. |
| 218 head = retained; | 218 head = retained; |
| 219 } else { | 219 } else { |
| 220 // Subsequent elements in the list. | 220 // Subsequent elements in the list. |
| 221 ASSERT(tail != NULL); | 221 DCHECK(tail != NULL); |
| 222 WeakListVisitor<T>::SetWeakNext(tail, retained); | 222 WeakListVisitor<T>::SetWeakNext(tail, retained); |
| 223 if (record_slots) { | 223 if (record_slots) { |
| 224 Object** next_slot = | 224 Object** next_slot = |
| 225 HeapObject::RawField(tail, WeakListVisitor<T>::WeakNextOffset()); | 225 HeapObject::RawField(tail, WeakListVisitor<T>::WeakNextOffset()); |
| 226 collector->RecordSlot(next_slot, next_slot, retained); | 226 collector->RecordSlot(next_slot, next_slot, retained); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 // Retained object is new tail. | 229 // Retained object is new tail. |
| 230 ASSERT(!retained->IsUndefined()); | 230 DCHECK(!retained->IsUndefined()); |
| 231 candidate = reinterpret_cast<T*>(retained); | 231 candidate = reinterpret_cast<T*>(retained); |
| 232 tail = candidate; | 232 tail = candidate; |
| 233 | 233 |
| 234 | 234 |
| 235 // tail is a live object, visit it. | 235 // tail is a live object, visit it. |
| 236 WeakListVisitor<T>::VisitLiveObject(heap, tail, retainer); | 236 WeakListVisitor<T>::VisitLiveObject(heap, tail, retainer); |
| 237 } else { | 237 } else { |
| 238 WeakListVisitor<T>::VisitPhantomObject(heap, candidate); | 238 WeakListVisitor<T>::VisitPhantomObject(heap, candidate); |
| 239 } | 239 } |
| 240 | 240 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 | 446 |
| 447 | 447 |
| 448 template Object* VisitWeakList<JSArrayBuffer>( | 448 template Object* VisitWeakList<JSArrayBuffer>( |
| 449 Heap* heap, Object* list, WeakObjectRetainer* retainer); | 449 Heap* heap, Object* list, WeakObjectRetainer* retainer); |
| 450 | 450 |
| 451 | 451 |
| 452 template Object* VisitWeakList<AllocationSite>( | 452 template Object* VisitWeakList<AllocationSite>( |
| 453 Heap* heap, Object* list, WeakObjectRetainer* retainer); | 453 Heap* heap, Object* list, WeakObjectRetainer* retainer); |
| 454 | 454 |
| 455 } } // namespace v8::internal | 455 } } // namespace v8::internal |
| OLD | NEW |