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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // Registration for kVisitJSRegExp is done by StaticVisitor. | 172 // Registration for kVisitJSRegExp is done by StaticVisitor. |
173 | 173 |
174 table_.Register( | 174 table_.Register( |
175 kVisitCell, | 175 kVisitCell, |
176 &FixedBodyVisitor<StaticVisitor, Cell::BodyDescriptor, void>::Visit); | 176 &FixedBodyVisitor<StaticVisitor, Cell::BodyDescriptor, void>::Visit); |
177 | 177 |
178 table_.Register(kVisitPropertyCell, &VisitPropertyCell); | 178 table_.Register(kVisitPropertyCell, &VisitPropertyCell); |
179 | 179 |
180 table_.Register(kVisitWeakCell, &VisitWeakCell); | 180 table_.Register(kVisitWeakCell, &VisitWeakCell); |
181 | 181 |
| 182 table_.Register(kVisitTransitionArray, &VisitTransitionArray); |
| 183 |
182 table_.template RegisterSpecializations<DataObjectVisitor, kVisitDataObject, | 184 table_.template RegisterSpecializations<DataObjectVisitor, kVisitDataObject, |
183 kVisitDataObjectGeneric>(); | 185 kVisitDataObjectGeneric>(); |
184 | 186 |
185 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSObject, | 187 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSObject, |
186 kVisitJSObjectGeneric>(); | 188 kVisitJSObjectGeneric>(); |
187 | 189 |
188 table_.template RegisterSpecializations<StructObjectVisitor, kVisitStruct, | 190 table_.template RegisterSpecializations<StructObjectVisitor, kVisitStruct, |
189 kVisitStructGeneric>(); | 191 kVisitStructGeneric>(); |
190 } | 192 } |
191 | 193 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 // closure. | 337 // closure. |
336 weak_cell->set_next(heap->encountered_weak_cells(), | 338 weak_cell->set_next(heap->encountered_weak_cells(), |
337 UPDATE_WEAK_WRITE_BARRIER); | 339 UPDATE_WEAK_WRITE_BARRIER); |
338 heap->set_encountered_weak_cells(weak_cell); | 340 heap->set_encountered_weak_cells(weak_cell); |
339 } | 341 } |
340 } | 342 } |
341 } | 343 } |
342 | 344 |
343 | 345 |
344 template <typename StaticVisitor> | 346 template <typename StaticVisitor> |
| 347 void StaticMarkingVisitor<StaticVisitor>::VisitTransitionArray( |
| 348 Map* map, HeapObject* object) { |
| 349 typedef FlexibleBodyVisitor<StaticVisitor, TransitionArray::BodyDescriptor, |
| 350 int> TransitionArrayBodyVisitor; |
| 351 TransitionArray* array = TransitionArray::cast(object); |
| 352 // Enqueue the array in linked list of encountered transition arrays if it is |
| 353 // not already in the list. |
| 354 if (array->next_link()->IsUndefined()) { |
| 355 Heap* heap = map->GetHeap(); |
| 356 array->set_next_link(heap->encountered_transition_arrays(), |
| 357 UPDATE_WEAK_WRITE_BARRIER); |
| 358 heap->set_encountered_transition_arrays(array); |
| 359 } |
| 360 // TODO(ulan): Move MarkTransitionArray logic here. |
| 361 TransitionArrayBodyVisitor::Visit(map, object); |
| 362 } |
| 363 |
| 364 |
| 365 template <typename StaticVisitor> |
345 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( | 366 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite( |
346 Map* map, HeapObject* object) { | 367 Map* map, HeapObject* object) { |
347 Heap* heap = map->GetHeap(); | 368 Heap* heap = map->GetHeap(); |
348 | 369 |
349 StaticVisitor::VisitPointers( | 370 StaticVisitor::VisitPointers( |
350 heap, object, | 371 heap, object, |
351 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset), | 372 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset), |
352 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset)); | 373 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset)); |
353 } | 374 } |
354 | 375 |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 773 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
753 void> JSFunctionWeakCodeBodyVisitor; | 774 void> JSFunctionWeakCodeBodyVisitor; |
754 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 775 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
755 } | 776 } |
756 | 777 |
757 | 778 |
758 } // namespace internal | 779 } // namespace internal |
759 } // namespace v8 | 780 } // namespace v8 |
760 | 781 |
761 #endif // V8_OBJECTS_VISITING_INL_H_ | 782 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |