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

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

Issue 1961403002: Revert of [heap] Fine-grained JSArrayBuffer tracking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/mark-compact.cc ('k') | test/cctest/cctest.gyp » ('j') | 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.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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot, 289 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot,
290 HeapObject* object) { 290 HeapObject* object) {
291 ObjectEvacuationStrategy<POINTER_OBJECT>::Visit(map, slot, object); 291 ObjectEvacuationStrategy<POINTER_OBJECT>::Visit(map, slot, object);
292 292
293 Heap* heap = map->GetHeap(); 293 Heap* heap = map->GetHeap();
294 MapWord map_word = object->map_word(); 294 MapWord map_word = object->map_word();
295 DCHECK(map_word.IsForwardingAddress()); 295 DCHECK(map_word.IsForwardingAddress());
296 HeapObject* target = map_word.ToForwardingAddress(); 296 HeapObject* target = map_word.ToForwardingAddress();
297 if (!heap->InNewSpace(target)) { 297 if (!heap->InNewSpace(target)) {
298 heap->array_buffer_tracker()->Promote( 298 heap->array_buffer_tracker()->Promote(JSArrayBuffer::cast(target));
299 JSArrayBuffer::cast(target),
300 reinterpret_cast<JSArrayBuffer*>(object));
301 } else {
302 heap->array_buffer_tracker()->SemiSpaceCopy(
303 JSArrayBuffer::cast(target),
304 reinterpret_cast<JSArrayBuffer*>(object));
305 } 299 }
306 } 300 }
307 301
308 302
309 static inline void EvacuateByteArray(Map* map, HeapObject** slot, 303 static inline void EvacuateByteArray(Map* map, HeapObject** slot,
310 HeapObject* object) { 304 HeapObject* object) {
311 int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize(); 305 int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize();
312 EvacuateObject<DATA_OBJECT, kWordAligned>(map, slot, object, object_size); 306 EvacuateObject<DATA_OBJECT, kWordAligned>(map, slot, object, object_size);
313 } 307 }
314 308
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 465
472 void ScavengeVisitor::ScavengePointer(Object** p) { 466 void ScavengeVisitor::ScavengePointer(Object** p) {
473 Object* object = *p; 467 Object* object = *p;
474 if (!heap_->InNewSpace(object)) return; 468 if (!heap_->InNewSpace(object)) return;
475 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), 469 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
476 reinterpret_cast<HeapObject*>(object)); 470 reinterpret_cast<HeapObject*>(object));
477 } 471 }
478 472
479 } // namespace internal 473 } // namespace internal
480 } // namespace v8 474 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698