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

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

Issue 2009893003: Revert of "[heap] Fine-grained JSArrayBuffer tracking" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/objects-visiting-inl.h ('k') | src/heap/spaces.h » ('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 int object_size = reinterpret_cast<FixedFloat64Array*>(object)->size(); 288 int object_size = reinterpret_cast<FixedFloat64Array*>(object)->size();
289 EvacuateObject<POINTER_OBJECT, kDoubleAligned>(map, slot, object, 289 EvacuateObject<POINTER_OBJECT, kDoubleAligned>(map, slot, object,
290 object_size, promotion_mode); 290 object_size, promotion_mode);
291 } 291 }
292 292
293 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot, 293 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot,
294 HeapObject* object, 294 HeapObject* object,
295 PromotionMode promotion_mode) { 295 PromotionMode promotion_mode) {
296 ObjectEvacuationStrategy<POINTER_OBJECT>::Visit(map, slot, object, 296 ObjectEvacuationStrategy<POINTER_OBJECT>::Visit(map, slot, object,
297 promotion_mode); 297 promotion_mode);
298
299 Heap* heap = map->GetHeap();
300 MapWord map_word = object->map_word();
301 DCHECK(map_word.IsForwardingAddress());
302 HeapObject* target = map_word.ToForwardingAddress();
303 if (!heap->InNewSpace(target)) {
304 heap->array_buffer_tracker()->Promote(JSArrayBuffer::cast(target));
305 }
298 } 306 }
299 307
300 static inline void EvacuateByteArray(Map* map, HeapObject** slot, 308 static inline void EvacuateByteArray(Map* map, HeapObject** slot,
301 HeapObject* object, 309 HeapObject* object,
302 PromotionMode promotion_mode) { 310 PromotionMode promotion_mode) {
303 int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize(); 311 int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize();
304 EvacuateObject<DATA_OBJECT, kWordAligned>(map, slot, object, object_size, 312 EvacuateObject<DATA_OBJECT, kWordAligned>(map, slot, object, object_size,
305 promotion_mode); 313 promotion_mode);
306 } 314 }
307 315
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 478
471 void ScavengeVisitor::ScavengePointer(Object** p) { 479 void ScavengeVisitor::ScavengePointer(Object** p) {
472 Object* object = *p; 480 Object* object = *p;
473 if (!heap_->InNewSpace(object)) return; 481 if (!heap_->InNewSpace(object)) return;
474 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), 482 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
475 reinterpret_cast<HeapObject*>(object)); 483 reinterpret_cast<HeapObject*>(object));
476 } 484 }
477 485
478 } // namespace internal 486 } // namespace internal
479 } // namespace v8 487 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/objects-visiting-inl.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698