| 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/array-buffer-tracker.h" |
| 9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
| 10 #include "src/ic/ic-state.h" | 10 #include "src/ic/ic-state.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, | 85 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, |
| 86 kVisitStructGeneric>(); | 86 kVisitStructGeneric>(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 template <typename StaticVisitor> | 90 template <typename StaticVisitor> |
| 91 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( | 91 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 92 Map* map, HeapObject* object) { | 92 Map* map, HeapObject* object) { |
| 93 Heap* heap = map->GetHeap(); | 93 Heap* heap = map->GetHeap(); |
| 94 | 94 |
| 95 VisitPointers( | 95 JSArrayBuffer::JSArrayBufferIterateBody< |
| 96 heap, object, | 96 StaticNewSpaceVisitor<StaticVisitor> >(heap, object); |
| 97 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | |
| 98 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | |
| 99 if (!JSArrayBuffer::cast(object)->is_external()) { | 97 if (!JSArrayBuffer::cast(object)->is_external()) { |
| 100 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); | 98 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); |
| 101 } | 99 } |
| 102 return JSArrayBuffer::kSizeWithInternalFields; | 100 return JSArrayBuffer::kSizeWithInternalFields; |
| 103 } | 101 } |
| 104 | 102 |
| 105 | 103 |
| 106 template <typename StaticVisitor> | 104 template <typename StaticVisitor> |
| 107 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( | 105 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( |
| 108 Map* map, HeapObject* object) { | 106 Map* map, HeapObject* object) { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 HeapObject::RawField(object, JSRegExp::kPropertiesOffset), | 519 HeapObject::RawField(object, JSRegExp::kPropertiesOffset), |
| 522 HeapObject::RawField(object, last_property_offset)); | 520 HeapObject::RawField(object, last_property_offset)); |
| 523 } | 521 } |
| 524 | 522 |
| 525 | 523 |
| 526 template <typename StaticVisitor> | 524 template <typename StaticVisitor> |
| 527 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( | 525 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 528 Map* map, HeapObject* object) { | 526 Map* map, HeapObject* object) { |
| 529 Heap* heap = map->GetHeap(); | 527 Heap* heap = map->GetHeap(); |
| 530 | 528 |
| 531 StaticVisitor::VisitPointers( | 529 JSArrayBuffer::JSArrayBufferIterateBody<StaticVisitor>(heap, object); |
| 532 heap, object, | |
| 533 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | |
| 534 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | |
| 535 if (!JSArrayBuffer::cast(object)->is_external() && | 530 if (!JSArrayBuffer::cast(object)->is_external() && |
| 536 !heap->InNewSpace(object)) { | 531 !heap->InNewSpace(object)) { |
| 537 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); | 532 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); |
| 538 } | 533 } |
| 539 } | 534 } |
| 540 | 535 |
| 541 | 536 |
| 542 template <typename StaticVisitor> | 537 template <typename StaticVisitor> |
| 543 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( | 538 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( |
| 544 Map* map, HeapObject* object) { | 539 Map* map, HeapObject* object) { |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 | 887 |
| 893 RelocIterator it(this, mode_mask); | 888 RelocIterator it(this, mode_mask); |
| 894 for (; !it.done(); it.next()) { | 889 for (; !it.done(); it.next()) { |
| 895 it.rinfo()->template Visit<StaticVisitor>(heap); | 890 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 896 } | 891 } |
| 897 } | 892 } |
| 898 } | 893 } |
| 899 } // namespace v8::internal | 894 } // namespace v8::internal |
| 900 | 895 |
| 901 #endif // V8_OBJECTS_VISITING_INL_H_ | 896 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |