| 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 #include "src/heap/objects-visiting.h" | 8 #include "src/heap/objects-visiting.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 template <typename StaticVisitor> | 79 template <typename StaticVisitor> |
| 80 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( | 80 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 81 Map* map, HeapObject* object) { | 81 Map* map, HeapObject* object) { |
| 82 Heap* heap = map->GetHeap(); | 82 Heap* heap = map->GetHeap(); |
| 83 | 83 |
| 84 VisitPointers( | 84 VisitPointers( |
| 85 heap, | 85 heap, |
| 86 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 86 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
| 87 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 87 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 88 if (!JSArrayBuffer::cast(object)->is_external()) { |
| 89 heap->RegisterLiveArrayBuffer(true, |
| 90 JSArrayBuffer::cast(object)->backing_store()); |
| 91 } |
| 88 return JSArrayBuffer::kSizeWithInternalFields; | 92 return JSArrayBuffer::kSizeWithInternalFields; |
| 89 } | 93 } |
| 90 | 94 |
| 91 | 95 |
| 92 template <typename StaticVisitor> | 96 template <typename StaticVisitor> |
| 93 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( | 97 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( |
| 94 Map* map, HeapObject* object) { | 98 Map* map, HeapObject* object) { |
| 95 VisitPointers( | 99 VisitPointers( |
| 96 map->GetHeap(), | 100 map->GetHeap(), |
| 97 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 101 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 template <typename StaticVisitor> | 501 template <typename StaticVisitor> |
| 498 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( | 502 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 499 Map* map, HeapObject* object) { | 503 Map* map, HeapObject* object) { |
| 500 Heap* heap = map->GetHeap(); | 504 Heap* heap = map->GetHeap(); |
| 501 | 505 |
| 502 StaticVisitor::VisitPointers( | 506 StaticVisitor::VisitPointers( |
| 503 heap, | 507 heap, |
| 504 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 508 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
| 505 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 509 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 506 if (!JSArrayBuffer::cast(object)->is_external()) { | 510 if (!JSArrayBuffer::cast(object)->is_external()) { |
| 507 heap->RegisterLiveArrayBuffer(JSArrayBuffer::cast(object)->backing_store()); | 511 heap->RegisterLiveArrayBuffer(heap->InNewSpace(object), |
| 512 JSArrayBuffer::cast(object)->backing_store()); |
| 508 } | 513 } |
| 509 } | 514 } |
| 510 | 515 |
| 511 | 516 |
| 512 template <typename StaticVisitor> | 517 template <typename StaticVisitor> |
| 513 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( | 518 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( |
| 514 Map* map, HeapObject* object) { | 519 Map* map, HeapObject* object) { |
| 515 StaticVisitor::VisitPointers( | 520 StaticVisitor::VisitPointers( |
| 516 map->GetHeap(), | 521 map->GetHeap(), |
| 517 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 522 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 | 836 |
| 832 RelocIterator it(this, mode_mask); | 837 RelocIterator it(this, mode_mask); |
| 833 for (; !it.done(); it.next()) { | 838 for (; !it.done(); it.next()) { |
| 834 it.rinfo()->template Visit<StaticVisitor>(heap); | 839 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 835 } | 840 } |
| 836 } | 841 } |
| 837 } | 842 } |
| 838 } // namespace v8::internal | 843 } // namespace v8::internal |
| 839 | 844 |
| 840 #endif // V8_OBJECTS_VISITING_INL_H_ | 845 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |