| 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/array-buffer-tracker.h" |
| 8 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
| 9 #include "src/ic/ic-state.h" | 10 #include "src/ic/ic-state.h" |
| 10 #include "src/macro-assembler.h" | 11 #include "src/macro-assembler.h" |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 | 15 |
| 15 | 16 |
| 16 template <typename Callback> | 17 template <typename Callback> |
| 17 Callback VisitorDispatchTable<Callback>::GetVisitor(Map* map) { | 18 Callback VisitorDispatchTable<Callback>::GetVisitor(Map* map) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 template <typename StaticVisitor> | 90 template <typename StaticVisitor> |
| 90 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( | 91 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 91 Map* map, HeapObject* object) { | 92 Map* map, HeapObject* object) { |
| 92 Heap* heap = map->GetHeap(); | 93 Heap* heap = map->GetHeap(); |
| 93 | 94 |
| 94 VisitPointers( | 95 VisitPointers( |
| 95 heap, object, | 96 heap, object, |
| 96 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 97 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
| 97 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 98 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 98 if (!JSArrayBuffer::cast(object)->is_external()) { | 99 if (!JSArrayBuffer::cast(object)->is_external()) { |
| 99 heap->RegisterLiveArrayBuffer(true, | 100 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); |
| 100 JSArrayBuffer::cast(object)->backing_store()); | |
| 101 } | 101 } |
| 102 return JSArrayBuffer::kSizeWithInternalFields; | 102 return JSArrayBuffer::kSizeWithInternalFields; |
| 103 } | 103 } |
| 104 | 104 |
| 105 | 105 |
| 106 template <typename StaticVisitor> | 106 template <typename StaticVisitor> |
| 107 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( | 107 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( |
| 108 Map* map, HeapObject* object) { | 108 Map* map, HeapObject* object) { |
| 109 VisitPointers( | 109 VisitPointers( |
| 110 map->GetHeap(), object, | 110 map->GetHeap(), object, |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( | 527 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 528 Map* map, HeapObject* object) { | 528 Map* map, HeapObject* object) { |
| 529 Heap* heap = map->GetHeap(); | 529 Heap* heap = map->GetHeap(); |
| 530 | 530 |
| 531 StaticVisitor::VisitPointers( | 531 StaticVisitor::VisitPointers( |
| 532 heap, object, | 532 heap, object, |
| 533 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 533 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
| 534 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 534 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 535 if (!JSArrayBuffer::cast(object)->is_external() && | 535 if (!JSArrayBuffer::cast(object)->is_external() && |
| 536 !heap->InNewSpace(object)) { | 536 !heap->InNewSpace(object)) { |
| 537 heap->RegisterLiveArrayBuffer(false, | 537 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); |
| 538 JSArrayBuffer::cast(object)->backing_store()); | |
| 539 } | 538 } |
| 540 } | 539 } |
| 541 | 540 |
| 542 | 541 |
| 543 template <typename StaticVisitor> | 542 template <typename StaticVisitor> |
| 544 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( | 543 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( |
| 545 Map* map, HeapObject* object) { | 544 Map* map, HeapObject* object) { |
| 546 StaticVisitor::VisitPointers( | 545 StaticVisitor::VisitPointers( |
| 547 map->GetHeap(), object, | 546 map->GetHeap(), object, |
| 548 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 547 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 | 892 |
| 894 RelocIterator it(this, mode_mask); | 893 RelocIterator it(this, mode_mask); |
| 895 for (; !it.done(); it.next()) { | 894 for (; !it.done(); it.next()) { |
| 896 it.rinfo()->template Visit<StaticVisitor>(heap); | 895 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 897 } | 896 } |
| 898 } | 897 } |
| 899 } | 898 } |
| 900 } // namespace v8::internal | 899 } // namespace v8::internal |
| 901 | 900 |
| 902 #endif // V8_OBJECTS_VISITING_INL_H_ | 901 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |