Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Side by Side Diff: src/heap/scavenger.cc

Issue 2723853006: [heap] Use ObjectMarking in TransferMark. (Closed)
Patch Set: [heap] Use ObjectMarking in TransferMark. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698