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