| 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-inl.h" | 8 #include "src/heap/heap-inl.h" |
| 9 #include "src/heap/incremental-marking.h" | 9 #include "src/heap/incremental-marking.h" |
| 10 #include "src/heap/objects-visiting-inl.h" | 10 #include "src/heap/objects-visiting-inl.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Set the forwarding address. | 140 // Set the forwarding address. |
| 141 source->set_map_word(MapWord::FromForwardingAddress(target)); | 141 source->set_map_word(MapWord::FromForwardingAddress(target)); |
| 142 | 142 |
| 143 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { | 143 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { |
| 144 // Update NewSpace stats if necessary. | 144 // Update NewSpace stats if necessary. |
| 145 RecordCopiedObject(heap, target); | 145 RecordCopiedObject(heap, target); |
| 146 heap->OnMoveEvent(target, source, size); | 146 heap->OnMoveEvent(target, source, size); |
| 147 } | 147 } |
| 148 | 148 |
| 149 if (marks_handling == TRANSFER_MARKS) { | 149 if (marks_handling == TRANSFER_MARKS) { |
| 150 if (IncrementalMarking::TransferColor(source, target, size)) { | 150 IncrementalMarking::TransferColor(source, target, size); |
| 151 MemoryChunk::IncrementLiveBytes(target, size); | |
| 152 } | |
| 153 } | 151 } |
| 154 } | 152 } |
| 155 | 153 |
| 156 template <AllocationAlignment alignment> | 154 template <AllocationAlignment alignment> |
| 157 static inline bool SemiSpaceCopyObject(Map* map, HeapObject** slot, | 155 static inline bool SemiSpaceCopyObject(Map* map, HeapObject** slot, |
| 158 HeapObject* object, int object_size) { | 156 HeapObject* object, int object_size) { |
| 159 Heap* heap = map->GetHeap(); | 157 Heap* heap = map->GetHeap(); |
| 160 | 158 |
| 161 DCHECK(heap->AllowedToBeMigrated(object, NEW_SPACE)); | 159 DCHECK(heap->AllowedToBeMigrated(object, NEW_SPACE)); |
| 162 AllocationResult allocation = | 160 AllocationResult allocation = |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 void ScavengeVisitor::ScavengePointer(Object** p) { | 468 void ScavengeVisitor::ScavengePointer(Object** p) { |
| 471 Object* object = *p; | 469 Object* object = *p; |
| 472 if (!heap_->InNewSpace(object)) return; | 470 if (!heap_->InNewSpace(object)) return; |
| 473 | 471 |
| 474 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 472 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
| 475 reinterpret_cast<HeapObject*>(object)); | 473 reinterpret_cast<HeapObject*>(object)); |
| 476 } | 474 } |
| 477 | 475 |
| 478 } // namespace internal | 476 } // namespace internal |
| 479 } // namespace v8 | 477 } // namespace v8 |
| OLD | NEW |