| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 STATIC_ASSERT(JSArrayBuffer::kWeakFirstViewOffset == | |
| 84 JSArrayBuffer::kWeakNextOffset + kPointerSize); | |
| 85 VisitPointers(heap, HeapObject::RawField( | 83 VisitPointers(heap, HeapObject::RawField( |
| 86 object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 84 object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
| 87 HeapObject::RawField(object, JSArrayBuffer::kWeakNextOffset)); | 85 HeapObject::RawField(object, JSArrayBuffer::kWeakNextOffset)); |
| 88 VisitPointers( | 86 VisitPointers( |
| 89 heap, HeapObject::RawField( | 87 heap, HeapObject::RawField(object, |
| 90 object, JSArrayBuffer::kWeakNextOffset + 2 * kPointerSize), | 88 JSArrayBuffer::kWeakNextOffset + kPointerSize), |
| 91 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 89 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 92 return JSArrayBuffer::kSizeWithInternalFields; | 90 return JSArrayBuffer::kSizeWithInternalFields; |
| 93 } | 91 } |
| 94 | 92 |
| 95 | 93 |
| 96 template <typename StaticVisitor> | 94 template <typename StaticVisitor> |
| 97 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( | 95 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( |
| 98 Map* map, HeapObject* object) { | 96 Map* map, HeapObject* object) { |
| 99 VisitPointers( | 97 VisitPointers( |
| 100 map->GetHeap(), | 98 map->GetHeap(), |
| 101 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 99 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
| 102 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); | |
| 103 VisitPointers( | |
| 104 map->GetHeap(), HeapObject::RawField( | |
| 105 object, JSTypedArray::kWeakNextOffset + kPointerSize), | |
| 106 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); | 100 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); |
| 107 return JSTypedArray::kSizeWithInternalFields; | 101 return JSTypedArray::kSizeWithInternalFields; |
| 108 } | 102 } |
| 109 | 103 |
| 110 | 104 |
| 111 template <typename StaticVisitor> | 105 template <typename StaticVisitor> |
| 112 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView(Map* map, | 106 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView(Map* map, |
| 113 HeapObject* object) { | 107 HeapObject* object) { |
| 114 VisitPointers( | 108 VisitPointers( |
| 115 map->GetHeap(), | 109 map->GetHeap(), |
| 116 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), | 110 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), |
| 117 HeapObject::RawField(object, JSDataView::kWeakNextOffset)); | |
| 118 VisitPointers( | |
| 119 map->GetHeap(), | |
| 120 HeapObject::RawField(object, JSDataView::kWeakNextOffset + kPointerSize), | |
| 121 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); | 111 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); |
| 122 return JSDataView::kSizeWithInternalFields; | 112 return JSDataView::kSizeWithInternalFields; |
| 123 } | 113 } |
| 124 | 114 |
| 125 | 115 |
| 126 template <typename StaticVisitor> | 116 template <typename StaticVisitor> |
| 127 void StaticMarkingVisitor<StaticVisitor>::Initialize() { | 117 void StaticMarkingVisitor<StaticVisitor>::Initialize() { |
| 128 table_.Register(kVisitShortcutCandidate, | 118 table_.Register(kVisitShortcutCandidate, |
| 129 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, | 119 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, |
| 130 void>::Visit); | 120 void>::Visit); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 map->GetHeap(), HeapObject::RawField(object, JSRegExp::kPropertiesOffset), | 523 map->GetHeap(), HeapObject::RawField(object, JSRegExp::kPropertiesOffset), |
| 534 HeapObject::RawField(object, last_property_offset)); | 524 HeapObject::RawField(object, last_property_offset)); |
| 535 } | 525 } |
| 536 | 526 |
| 537 | 527 |
| 538 template <typename StaticVisitor> | 528 template <typename StaticVisitor> |
| 539 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( | 529 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 540 Map* map, HeapObject* object) { | 530 Map* map, HeapObject* object) { |
| 541 Heap* heap = map->GetHeap(); | 531 Heap* heap = map->GetHeap(); |
| 542 | 532 |
| 543 STATIC_ASSERT(JSArrayBuffer::kWeakFirstViewOffset == | |
| 544 JSArrayBuffer::kWeakNextOffset + kPointerSize); | |
| 545 StaticVisitor::VisitPointers( | 533 StaticVisitor::VisitPointers( |
| 546 heap, | 534 heap, |
| 547 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), | 535 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), |
| 548 HeapObject::RawField(object, JSArrayBuffer::kWeakNextOffset)); | 536 HeapObject::RawField(object, JSArrayBuffer::kWeakNextOffset)); |
| 549 StaticVisitor::VisitPointers( | 537 StaticVisitor::VisitPointers( |
| 550 heap, HeapObject::RawField( | 538 heap, HeapObject::RawField(object, |
| 551 object, JSArrayBuffer::kWeakNextOffset + 2 * kPointerSize), | 539 JSArrayBuffer::kWeakNextOffset + kPointerSize), |
| 552 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); | 540 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); |
| 553 } | 541 } |
| 554 | 542 |
| 555 | 543 |
| 556 template <typename StaticVisitor> | 544 template <typename StaticVisitor> |
| 557 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( | 545 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( |
| 558 Map* map, HeapObject* object) { | 546 Map* map, HeapObject* object) { |
| 559 StaticVisitor::VisitPointers( | 547 StaticVisitor::VisitPointers( |
| 560 map->GetHeap(), | 548 map->GetHeap(), |
| 561 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 549 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
| 562 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); | |
| 563 StaticVisitor::VisitPointers( | |
| 564 map->GetHeap(), HeapObject::RawField( | |
| 565 object, JSTypedArray::kWeakNextOffset + kPointerSize), | |
| 566 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); | 550 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); |
| 567 } | 551 } |
| 568 | 552 |
| 569 | 553 |
| 570 template <typename StaticVisitor> | 554 template <typename StaticVisitor> |
| 571 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(Map* map, | 555 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(Map* map, |
| 572 HeapObject* object) { | 556 HeapObject* object) { |
| 573 StaticVisitor::VisitPointers( | 557 StaticVisitor::VisitPointers( |
| 574 map->GetHeap(), | 558 map->GetHeap(), |
| 575 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), | 559 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), |
| 576 HeapObject::RawField(object, JSDataView::kWeakNextOffset)); | |
| 577 StaticVisitor::VisitPointers( | |
| 578 map->GetHeap(), | |
| 579 HeapObject::RawField(object, JSDataView::kWeakNextOffset + kPointerSize), | |
| 580 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); | 560 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); |
| 581 } | 561 } |
| 582 | 562 |
| 583 | 563 |
| 584 template <typename StaticVisitor> | 564 template <typename StaticVisitor> |
| 585 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap, | 565 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap, |
| 586 Map* map) { | 566 Map* map) { |
| 587 Object* raw_transitions = map->raw_transitions(); | 567 Object* raw_transitions = map->raw_transitions(); |
| 588 if (TransitionArray::IsFullTransitionArray(raw_transitions)) { | 568 if (TransitionArray::IsFullTransitionArray(raw_transitions)) { |
| 589 MarkTransitionArray(heap, TransitionArray::cast(raw_transitions)); | 569 MarkTransitionArray(heap, TransitionArray::cast(raw_transitions)); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 | 874 |
| 895 RelocIterator it(this, mode_mask); | 875 RelocIterator it(this, mode_mask); |
| 896 for (; !it.done(); it.next()) { | 876 for (; !it.done(); it.next()) { |
| 897 it.rinfo()->template Visit<StaticVisitor>(heap); | 877 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 898 } | 878 } |
| 899 } | 879 } |
| 900 } | 880 } |
| 901 } // namespace v8::internal | 881 } // namespace v8::internal |
| 902 | 882 |
| 903 #endif // V8_OBJECTS_VISITING_INL_H_ | 883 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |