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