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 #include "src/ic/ic-state.h" | 9 #include "src/ic/ic-state.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 HeapObject* object) { | 119 HeapObject* object) { |
120 VisitPointers( | 120 VisitPointers( |
121 map->GetHeap(), object, | 121 map->GetHeap(), object, |
122 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), | 122 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), |
123 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); | 123 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); |
124 return JSDataView::kSizeWithInternalFields; | 124 return JSDataView::kSizeWithInternalFields; |
125 } | 125 } |
126 | 126 |
127 | 127 |
128 template <typename StaticVisitor> | 128 template <typename StaticVisitor> |
| 129 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( |
| 130 Map* map, HeapObject* object) { |
| 131 VisitPointers( |
| 132 map->GetHeap(), object, |
| 133 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), |
| 134 HeapObject::RawField(object, BytecodeArray::kHeaderSize)); |
| 135 return reinterpret_cast<BytecodeArray*>(object)->BytecodeArraySize(); |
| 136 } |
| 137 |
| 138 |
| 139 template <typename StaticVisitor> |
129 void StaticMarkingVisitor<StaticVisitor>::Initialize() { | 140 void StaticMarkingVisitor<StaticVisitor>::Initialize() { |
130 table_.Register(kVisitShortcutCandidate, | 141 table_.Register(kVisitShortcutCandidate, |
131 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, | 142 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, |
132 void>::Visit); | 143 void>::Visit); |
133 | 144 |
134 table_.Register(kVisitConsString, | 145 table_.Register(kVisitConsString, |
135 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, | 146 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, |
136 void>::Visit); | 147 void>::Visit); |
137 | 148 |
138 table_.Register(kVisitSlicedString, | 149 table_.Register(kVisitSlicedString, |
(...skipping 11 matching lines...) Expand all Loading... |
150 table_.Register(kVisitFixedTypedArray, &DataObjectVisitor::Visit); | 161 table_.Register(kVisitFixedTypedArray, &DataObjectVisitor::Visit); |
151 | 162 |
152 table_.Register(kVisitFixedFloat64Array, &DataObjectVisitor::Visit); | 163 table_.Register(kVisitFixedFloat64Array, &DataObjectVisitor::Visit); |
153 | 164 |
154 table_.Register(kVisitNativeContext, &VisitNativeContext); | 165 table_.Register(kVisitNativeContext, &VisitNativeContext); |
155 | 166 |
156 table_.Register(kVisitAllocationSite, &VisitAllocationSite); | 167 table_.Register(kVisitAllocationSite, &VisitAllocationSite); |
157 | 168 |
158 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); | 169 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); |
159 | 170 |
160 table_.Register(kVisitBytecodeArray, &DataObjectVisitor::Visit); | 171 table_.Register(kVisitBytecodeArray, &VisitBytecodeArray); |
161 | 172 |
162 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); | 173 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); |
163 | 174 |
164 table_.Register(kVisitSeqOneByteString, &DataObjectVisitor::Visit); | 175 table_.Register(kVisitSeqOneByteString, &DataObjectVisitor::Visit); |
165 | 176 |
166 table_.Register(kVisitSeqTwoByteString, &DataObjectVisitor::Visit); | 177 table_.Register(kVisitSeqTwoByteString, &DataObjectVisitor::Visit); |
167 | 178 |
168 table_.Register(kVisitJSWeakCollection, &VisitWeakCollection); | 179 table_.Register(kVisitJSWeakCollection, &VisitWeakCollection); |
169 | 180 |
170 table_.Register( | 181 table_.Register( |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(Map* map, | 553 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(Map* map, |
543 HeapObject* object) { | 554 HeapObject* object) { |
544 StaticVisitor::VisitPointers( | 555 StaticVisitor::VisitPointers( |
545 map->GetHeap(), object, | 556 map->GetHeap(), object, |
546 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), | 557 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), |
547 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); | 558 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); |
548 } | 559 } |
549 | 560 |
550 | 561 |
551 template <typename StaticVisitor> | 562 template <typename StaticVisitor> |
| 563 void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray( |
| 564 Map* map, HeapObject* object) { |
| 565 StaticVisitor::VisitPointers( |
| 566 map->GetHeap(), object, |
| 567 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), |
| 568 HeapObject::RawField(object, BytecodeArray::kHeaderSize)); |
| 569 } |
| 570 |
| 571 |
| 572 template <typename StaticVisitor> |
552 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap, | 573 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap, |
553 Map* map) { | 574 Map* map) { |
554 Object* raw_transitions = map->raw_transitions(); | 575 Object* raw_transitions = map->raw_transitions(); |
555 if (TransitionArray::IsFullTransitionArray(raw_transitions)) { | 576 if (TransitionArray::IsFullTransitionArray(raw_transitions)) { |
556 MarkTransitionArray(heap, TransitionArray::cast(raw_transitions)); | 577 MarkTransitionArray(heap, TransitionArray::cast(raw_transitions)); |
557 } | 578 } |
558 | 579 |
559 // Since descriptor arrays are potentially shared, ensure that only the | 580 // Since descriptor arrays are potentially shared, ensure that only the |
560 // descriptors that belong to this map are marked. The first time a non-empty | 581 // descriptors that belong to this map are marked. The first time a non-empty |
561 // descriptor array is marked, its header is also visited. The slot holding | 582 // descriptor array is marked, its header is also visited. The slot holding |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 892 |
872 RelocIterator it(this, mode_mask); | 893 RelocIterator it(this, mode_mask); |
873 for (; !it.done(); it.next()) { | 894 for (; !it.done(); it.next()) { |
874 it.rinfo()->template Visit<StaticVisitor>(heap); | 895 it.rinfo()->template Visit<StaticVisitor>(heap); |
875 } | 896 } |
876 } | 897 } |
877 } | 898 } |
878 } // namespace v8::internal | 899 } // namespace v8::internal |
879 | 900 |
880 #endif // V8_OBJECTS_VISITING_INL_H_ | 901 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |