| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/scavenger.h" | 5 #include "src/heap/scavenger.h" |
| 6 | 6 |
| 7 #include "src/contexts.h" | 7 #include "src/contexts.h" |
| 8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
| 9 #include "src/heap/objects-visiting-inl.h" | 9 #include "src/heap/objects-visiting-inl.h" |
| 10 #include "src/heap/scavenger-inl.h" | 10 #include "src/heap/scavenger-inl.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 DCHECK(map_word.IsForwardingAddress()); | 303 DCHECK(map_word.IsForwardingAddress()); |
| 304 FixedTypedArrayBase* target = | 304 FixedTypedArrayBase* target = |
| 305 reinterpret_cast<FixedTypedArrayBase*>(map_word.ToForwardingAddress()); | 305 reinterpret_cast<FixedTypedArrayBase*>(map_word.ToForwardingAddress()); |
| 306 if (target->base_pointer() != Smi::FromInt(0)) | 306 if (target->base_pointer() != Smi::FromInt(0)) |
| 307 target->set_base_pointer(target, SKIP_WRITE_BARRIER); | 307 target->set_base_pointer(target, SKIP_WRITE_BARRIER); |
| 308 } | 308 } |
| 309 | 309 |
| 310 | 310 |
| 311 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot, | 311 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot, |
| 312 HeapObject* object) { | 312 HeapObject* object) { |
| 313 ObjectEvacuationStrategy<POINTER_OBJECT>::Visit(map, slot, object); | 313 ObjectEvacuationStrategy<DATA_OBJECT>::Visit(map, slot, object); |
| 314 | 314 |
| 315 Heap* heap = map->GetHeap(); | 315 Heap* heap = map->GetHeap(); |
| 316 MapWord map_word = object->map_word(); | 316 MapWord map_word = object->map_word(); |
| 317 DCHECK(map_word.IsForwardingAddress()); | 317 DCHECK(map_word.IsForwardingAddress()); |
| 318 HeapObject* target = map_word.ToForwardingAddress(); | 318 HeapObject* target = map_word.ToForwardingAddress(); |
| 319 if (!heap->InNewSpace(target)) { | 319 if (!heap->InNewSpace(target)) { |
| 320 heap->array_buffer_tracker()->Promote(JSArrayBuffer::cast(target)); | 320 heap->array_buffer_tracker()->Promote(JSArrayBuffer::cast(target)); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 487 |
| 488 void ScavengeVisitor::ScavengePointer(Object** p) { | 488 void ScavengeVisitor::ScavengePointer(Object** p) { |
| 489 Object* object = *p; | 489 Object* object = *p; |
| 490 if (!heap_->InNewSpace(object)) return; | 490 if (!heap_->InNewSpace(object)) return; |
| 491 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 491 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
| 492 reinterpret_cast<HeapObject*>(object)); | 492 reinterpret_cast<HeapObject*>(object)); |
| 493 } | 493 } |
| 494 | 494 |
| 495 } // namespace internal | 495 } // namespace internal |
| 496 } // namespace v8 | 496 } // namespace v8 |
| OLD | NEW |