OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( | 129 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( |
130 Map* map, HeapObject* object) { | 130 Map* map, HeapObject* object) { |
131 VisitPointers( | 131 VisitPointers( |
132 map->GetHeap(), | 132 map->GetHeap(), |
133 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 133 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
134 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); | 134 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); |
135 VisitPointers( | 135 VisitPointers( |
136 map->GetHeap(), | 136 map->GetHeap(), |
137 HeapObject::RawField(object, | 137 HeapObject::RawField(object, |
138 JSTypedArray::kWeakNextOffset + kPointerSize), | 138 JSTypedArray::kWeakNextOffset + kPointerSize), |
139 HeapObject::RawField(object, JSTypedArray::kSize)); | 139 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); |
140 return JSTypedArray::kSize; | 140 return JSTypedArray::kSizeWithInternalFields; |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 template<typename StaticVisitor> | 144 template<typename StaticVisitor> |
145 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView( | 145 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView( |
146 Map* map, HeapObject* object) { | 146 Map* map, HeapObject* object) { |
147 VisitPointers( | 147 VisitPointers( |
148 map->GetHeap(), | 148 map->GetHeap(), |
149 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), | 149 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), |
150 HeapObject::RawField(object, JSDataView::kWeakNextOffset)); | 150 HeapObject::RawField(object, JSDataView::kWeakNextOffset)); |
151 VisitPointers( | 151 VisitPointers( |
152 map->GetHeap(), | 152 map->GetHeap(), |
153 HeapObject::RawField(object, | 153 HeapObject::RawField(object, |
154 JSDataView::kWeakNextOffset + kPointerSize), | 154 JSDataView::kWeakNextOffset + kPointerSize), |
155 HeapObject::RawField(object, JSDataView::kSize)); | 155 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); |
156 return JSDataView::kSize; | 156 return JSDataView::kSizeWithInternalFields; |
157 } | 157 } |
158 | 158 |
159 | 159 |
160 template<typename StaticVisitor> | 160 template<typename StaticVisitor> |
161 void StaticMarkingVisitor<StaticVisitor>::Initialize() { | 161 void StaticMarkingVisitor<StaticVisitor>::Initialize() { |
162 table_.Register(kVisitShortcutCandidate, | 162 table_.Register(kVisitShortcutCandidate, |
163 &FixedBodyVisitor<StaticVisitor, | 163 &FixedBodyVisitor<StaticVisitor, |
164 ConsString::BodyDescriptor, | 164 ConsString::BodyDescriptor, |
165 void>::Visit); | 165 void>::Visit); |
166 | 166 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( | 515 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( |
516 Map* map, HeapObject* object) { | 516 Map* map, HeapObject* object) { |
517 StaticVisitor::VisitPointers( | 517 StaticVisitor::VisitPointers( |
518 map->GetHeap(), | 518 map->GetHeap(), |
519 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), | 519 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), |
520 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); | 520 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); |
521 StaticVisitor::VisitPointers( | 521 StaticVisitor::VisitPointers( |
522 map->GetHeap(), | 522 map->GetHeap(), |
523 HeapObject::RawField(object, | 523 HeapObject::RawField(object, |
524 JSTypedArray::kWeakNextOffset + kPointerSize), | 524 JSTypedArray::kWeakNextOffset + kPointerSize), |
525 HeapObject::RawField(object, JSTypedArray::kSize)); | 525 HeapObject::RawField(object, JSTypedArray::kSizeWithInternalFields)); |
526 } | 526 } |
527 | 527 |
528 | 528 |
529 template<typename StaticVisitor> | 529 template<typename StaticVisitor> |
530 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView( | 530 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView( |
531 Map* map, HeapObject* object) { | 531 Map* map, HeapObject* object) { |
532 StaticVisitor::VisitPointers( | 532 StaticVisitor::VisitPointers( |
533 map->GetHeap(), | 533 map->GetHeap(), |
534 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), | 534 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset), |
535 HeapObject::RawField(object, JSDataView::kWeakNextOffset)); | 535 HeapObject::RawField(object, JSDataView::kWeakNextOffset)); |
536 StaticVisitor::VisitPointers( | 536 StaticVisitor::VisitPointers( |
537 map->GetHeap(), | 537 map->GetHeap(), |
538 HeapObject::RawField(object, | 538 HeapObject::RawField(object, |
539 JSDataView::kWeakNextOffset + kPointerSize), | 539 JSDataView::kWeakNextOffset + kPointerSize), |
540 HeapObject::RawField(object, JSDataView::kSize)); | 540 HeapObject::RawField(object, JSDataView::kSizeWithInternalFields)); |
541 } | 541 } |
542 | 542 |
543 | 543 |
544 template<typename StaticVisitor> | 544 template<typename StaticVisitor> |
545 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents( | 545 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents( |
546 Heap* heap, Map* map) { | 546 Heap* heap, Map* map) { |
547 // Make sure that the back pointer stored either in the map itself or | 547 // Make sure that the back pointer stored either in the map itself or |
548 // inside its transitions array is marked. Skip recording the back | 548 // inside its transitions array is marked. Skip recording the back |
549 // pointer slot since map space is not compacted. | 549 // pointer slot since map space is not compacted. |
550 StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer())); | 550 StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer())); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 RelocIterator it(this, mode_mask); | 873 RelocIterator it(this, mode_mask); |
874 for (; !it.done(); it.next()) { | 874 for (; !it.done(); it.next()) { |
875 it.rinfo()->template Visit<StaticVisitor>(heap); | 875 it.rinfo()->template Visit<StaticVisitor>(heap); |
876 } | 876 } |
877 } | 877 } |
878 | 878 |
879 | 879 |
880 } } // namespace v8::internal | 880 } } // namespace v8::internal |
881 | 881 |
882 #endif // V8_OBJECTS_VISITING_INL_H_ | 882 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |