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

Side by Side Diff: src/heap/objects-visiting-inl.h

Issue 1115853004: Reland "Remove the weak list of array buffers" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ignore empty array buffers Created 5 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_OBJECTS_VISITING_INL_H_ 5 #ifndef V8_OBJECTS_VISITING_INL_H_
6 #define V8_OBJECTS_VISITING_INL_H_ 6 #define V8_OBJECTS_VISITING_INL_H_
7 7
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, 73 table_.template RegisterSpecializations<StructVisitor, kVisitStruct,
74 kVisitStructGeneric>(); 74 kVisitStructGeneric>();
75 } 75 }
76 76
77 77
78 template <typename StaticVisitor> 78 template <typename StaticVisitor>
79 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( 79 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
80 Map* map, HeapObject* object) { 80 Map* map, HeapObject* object) {
81 Heap* heap = map->GetHeap(); 81 Heap* heap = map->GetHeap();
82 82
83 VisitPointers(heap, HeapObject::RawField(
84 object, JSArrayBuffer::BodyDescriptor::kStartOffset),
85 HeapObject::RawField(object, JSArrayBuffer::kWeakNextOffset));
86 VisitPointers( 83 VisitPointers(
87 heap, HeapObject::RawField(object, 84 heap,
88 JSArrayBuffer::kWeakNextOffset + kPointerSize), 85 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
89 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); 86 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
90 return JSArrayBuffer::kSizeWithInternalFields; 87 return JSArrayBuffer::kSizeWithInternalFields;
91 } 88 }
92 89
93 90
94 template <typename StaticVisitor> 91 template <typename StaticVisitor>
95 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( 92 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray(
96 Map* map, HeapObject* object) { 93 Map* map, HeapObject* object) {
97 VisitPointers( 94 VisitPointers(
98 map->GetHeap(), 95 map->GetHeap(),
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 523
527 524
528 template <typename StaticVisitor> 525 template <typename StaticVisitor>
529 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( 526 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
530 Map* map, HeapObject* object) { 527 Map* map, HeapObject* object) {
531 Heap* heap = map->GetHeap(); 528 Heap* heap = map->GetHeap();
532 529
533 StaticVisitor::VisitPointers( 530 StaticVisitor::VisitPointers(
534 heap, 531 heap,
535 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), 532 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
536 HeapObject::RawField(object, JSArrayBuffer::kWeakNextOffset));
537 StaticVisitor::VisitPointers(
538 heap, HeapObject::RawField(object,
539 JSArrayBuffer::kWeakNextOffset + kPointerSize),
540 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); 533 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
534 if (!JSArrayBuffer::cast(object)->is_external()) {
535 heap->RegisterLiveArrayBuffer(JSArrayBuffer::cast(object)->backing_store());
536 }
541 } 537 }
542 538
543 539
544 template <typename StaticVisitor> 540 template <typename StaticVisitor>
545 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( 541 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray(
546 Map* map, HeapObject* object) { 542 Map* map, HeapObject* object) {
547 StaticVisitor::VisitPointers( 543 StaticVisitor::VisitPointers(
548 map->GetHeap(), 544 map->GetHeap(),
549 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), 545 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset),
550 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); 546 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields));
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 870
875 RelocIterator it(this, mode_mask); 871 RelocIterator it(this, mode_mask);
876 for (; !it.done(); it.next()) { 872 for (; !it.done(); it.next()) {
877 it.rinfo()->template Visit<StaticVisitor>(heap); 873 it.rinfo()->template Visit<StaticVisitor>(heap);
878 } 874 }
879 } 875 }
880 } 876 }
881 } // namespace v8::internal 877 } // namespace v8::internal
882 878
883 #endif // V8_OBJECTS_VISITING_INL_H_ 879 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« src/heap/heap.cc ('K') | « src/heap/objects-visiting.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698