OLD | NEW |
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 83 VisitPointers( |
84 heap, | 84 heap, |
85 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 85 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
86 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 86 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 87 if (!JSArrayBuffer::cast(object)->is_external()) { |
| 88 heap->RegisterLiveArrayBuffer(true, |
| 89 JSArrayBuffer::cast(object)->backing_store()); |
| 90 } |
87 return JSArrayBuffer::kSizeWithInternalFields; | 91 return JSArrayBuffer::kSizeWithInternalFields; |
88 } | 92 } |
89 | 93 |
90 | 94 |
91 template <typename StaticVisitor> | 95 template <typename StaticVisitor> |
92 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( | 96 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( |
93 Map* map, HeapObject* object) { | 97 Map* map, HeapObject* object) { |
94 VisitPointers( | 98 VisitPointers( |
95 map->GetHeap(), | 99 map->GetHeap(), |
96 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 100 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 template <typename StaticVisitor> | 529 template <typename StaticVisitor> |
526 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( | 530 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( |
527 Map* map, HeapObject* object) { | 531 Map* map, HeapObject* object) { |
528 Heap* heap = map->GetHeap(); | 532 Heap* heap = map->GetHeap(); |
529 | 533 |
530 StaticVisitor::VisitPointers( | 534 StaticVisitor::VisitPointers( |
531 heap, | 535 heap, |
532 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 536 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
533 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 537 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
534 if (!JSArrayBuffer::cast(object)->is_external()) { | 538 if (!JSArrayBuffer::cast(object)->is_external()) { |
535 heap->RegisterLiveArrayBuffer(JSArrayBuffer::cast(object)->backing_store()); | 539 heap->RegisterLiveArrayBuffer(heap->InNewSpace(object), |
| 540 JSArrayBuffer::cast(object)->backing_store()); |
536 } | 541 } |
537 } | 542 } |
538 | 543 |
539 | 544 |
540 template <typename StaticVisitor> | 545 template <typename StaticVisitor> |
541 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( | 546 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( |
542 Map* map, HeapObject* object) { | 547 Map* map, HeapObject* object) { |
543 StaticVisitor::VisitPointers( | 548 StaticVisitor::VisitPointers( |
544 map->GetHeap(), | 549 map->GetHeap(), |
545 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 550 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 875 |
871 RelocIterator it(this, mode_mask); | 876 RelocIterator it(this, mode_mask); |
872 for (; !it.done(); it.next()) { | 877 for (; !it.done(); it.next()) { |
873 it.rinfo()->template Visit<StaticVisitor>(heap); | 878 it.rinfo()->template Visit<StaticVisitor>(heap); |
874 } | 879 } |
875 } | 880 } |
876 } | 881 } |
877 } // namespace v8::internal | 882 } // namespace v8::internal |
878 | 883 |
879 #endif // V8_OBJECTS_VISITING_INL_H_ | 884 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |