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

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

Issue 2032973002: Revert of Reland "[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 18 matching lines...) Expand all
29 public: 29 public:
30 static void Initialize() { 30 static void Initialize() {
31 table_.Register(kVisitSeqOneByteString, &EvacuateSeqOneByteString); 31 table_.Register(kVisitSeqOneByteString, &EvacuateSeqOneByteString);
32 table_.Register(kVisitSeqTwoByteString, &EvacuateSeqTwoByteString); 32 table_.Register(kVisitSeqTwoByteString, &EvacuateSeqTwoByteString);
33 table_.Register(kVisitShortcutCandidate, &EvacuateShortcutCandidate); 33 table_.Register(kVisitShortcutCandidate, &EvacuateShortcutCandidate);
34 table_.Register(kVisitByteArray, &EvacuateByteArray); 34 table_.Register(kVisitByteArray, &EvacuateByteArray);
35 table_.Register(kVisitFixedArray, &EvacuateFixedArray); 35 table_.Register(kVisitFixedArray, &EvacuateFixedArray);
36 table_.Register(kVisitFixedDoubleArray, &EvacuateFixedDoubleArray); 36 table_.Register(kVisitFixedDoubleArray, &EvacuateFixedDoubleArray);
37 table_.Register(kVisitFixedTypedArray, &EvacuateFixedTypedArray); 37 table_.Register(kVisitFixedTypedArray, &EvacuateFixedTypedArray);
38 table_.Register(kVisitFixedFloat64Array, &EvacuateFixedFloat64Array); 38 table_.Register(kVisitFixedFloat64Array, &EvacuateFixedFloat64Array);
39 table_.Register(kVisitJSArrayBuffer, 39 table_.Register(kVisitJSArrayBuffer, &EvacuateJSArrayBuffer);
40 &ObjectEvacuationStrategy<POINTER_OBJECT>::Visit);
41 40
42 table_.Register( 41 table_.Register(
43 kVisitNativeContext, 42 kVisitNativeContext,
44 &ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< 43 &ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized<
45 Context::kSize>); 44 Context::kSize>);
46 45
47 table_.Register( 46 table_.Register(
48 kVisitConsString, 47 kVisitConsString,
49 &ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< 48 &ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized<
50 ConsString::kSize>); 49 ConsString::kSize>);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 object_size); 274 object_size);
276 } 275 }
277 276
278 static inline void EvacuateFixedFloat64Array(Map* map, HeapObject** slot, 277 static inline void EvacuateFixedFloat64Array(Map* map, HeapObject** slot,
279 HeapObject* object) { 278 HeapObject* object) {
280 int object_size = reinterpret_cast<FixedFloat64Array*>(object)->size(); 279 int object_size = reinterpret_cast<FixedFloat64Array*>(object)->size();
281 EvacuateObject<POINTER_OBJECT, kDoubleAligned>(map, slot, object, 280 EvacuateObject<POINTER_OBJECT, kDoubleAligned>(map, slot, object,
282 object_size); 281 object_size);
283 } 282 }
284 283
284 static inline void EvacuateJSArrayBuffer(Map* map, HeapObject** slot,
285 HeapObject* object) {
286 ObjectEvacuationStrategy<POINTER_OBJECT>::Visit(map, slot, object);
287
288 Heap* heap = map->GetHeap();
289 MapWord map_word = object->map_word();
290 DCHECK(map_word.IsForwardingAddress());
291 HeapObject* target = map_word.ToForwardingAddress();
292 if (!heap->InNewSpace(target)) {
293 heap->array_buffer_tracker()->Promote(JSArrayBuffer::cast(target));
294 }
295 }
296
285 static inline void EvacuateByteArray(Map* map, HeapObject** slot, 297 static inline void EvacuateByteArray(Map* map, HeapObject** slot,
286 HeapObject* object) { 298 HeapObject* object) {
287 int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize(); 299 int object_size = reinterpret_cast<ByteArray*>(object)->ByteArraySize();
288 EvacuateObject<DATA_OBJECT, kWordAligned>(map, slot, object, object_size); 300 EvacuateObject<DATA_OBJECT, kWordAligned>(map, slot, object, object_size);
289 } 301 }
290 302
291 static inline void EvacuateSeqOneByteString(Map* map, HeapObject** slot, 303 static inline void EvacuateSeqOneByteString(Map* map, HeapObject** slot,
292 HeapObject* object) { 304 HeapObject* object) {
293 int object_size = SeqOneByteString::cast(object) 305 int object_size = SeqOneByteString::cast(object)
294 ->SeqOneByteStringSize(map->instance_type()); 306 ->SeqOneByteStringSize(map->instance_type());
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 456
445 void ScavengeVisitor::ScavengePointer(Object** p) { 457 void ScavengeVisitor::ScavengePointer(Object** p) {
446 Object* object = *p; 458 Object* object = *p;
447 if (!heap_->InNewSpace(object)) return; 459 if (!heap_->InNewSpace(object)) return;
448 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p), 460 Scavenger::ScavengeObject(reinterpret_cast<HeapObject**>(p),
449 reinterpret_cast<HeapObject*>(object)); 461 reinterpret_cast<HeapObject*>(object));
450 } 462 }
451 463
452 } // namespace internal 464 } // namespace internal
453 } // namespace v8 465 } // 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