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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Set the forwarding address. | 131 // Set the forwarding address. |
132 source->set_map_word(MapWord::FromForwardingAddress(target)); | 132 source->set_map_word(MapWord::FromForwardingAddress(target)); |
133 | 133 |
134 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { | 134 if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) { |
135 // Update NewSpace stats if necessary. | 135 // Update NewSpace stats if necessary. |
136 RecordCopiedObject(heap, target); | 136 RecordCopiedObject(heap, target); |
137 heap->OnMoveEvent(target, source, size); | 137 heap->OnMoveEvent(target, source, size); |
138 } | 138 } |
139 | 139 |
140 if (marks_handling == TRANSFER_MARKS) { | 140 if (marks_handling == TRANSFER_MARKS) { |
141 if (IncrementalMarking::TransferColor(source, target)) { | 141 IncrementalMarking::TransferColor(source, target, size); |
142 MemoryChunk::IncrementLiveBytesFromGC(target, size); | |
143 } | |
144 } | 142 } |
145 } | 143 } |
146 | 144 |
147 template <AllocationAlignment alignment> | 145 template <AllocationAlignment alignment> |
148 static inline bool SemiSpaceCopyObject(Map* map, HeapObject** slot, | 146 static inline bool SemiSpaceCopyObject(Map* map, HeapObject** slot, |
149 HeapObject* object, int object_size) { | 147 HeapObject* object, int object_size) { |
150 Heap* heap = map->GetHeap(); | 148 Heap* heap = map->GetHeap(); |
151 | 149 |
152 DCHECK(heap->AllowedToBeMigrated(object, NEW_SPACE)); | 150 DCHECK(heap->AllowedToBeMigrated(object, NEW_SPACE)); |
153 AllocationResult allocation = | 151 AllocationResult allocation = |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 void ScavengeVisitor::ScavengePointer(Object** p) { | 442 void ScavengeVisitor::ScavengePointer(Object** p) { |
445 Object* object = *p; | 443 Object* object = *p; |
446 if (!heap_->InNewSpace(object)) return; | 444 if (!heap_->InNewSpace(object)) return; |
447 | 445 |
448 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 446 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
449 reinterpret_cast<HeapObject*>(object)); | 447 reinterpret_cast<HeapObject*>(object)); |
450 } | 448 } |
451 | 449 |
452 } // namespace internal | 450 } // namespace internal |
453 } // namespace v8 | 451 } // namespace v8 |
OLD | NEW |