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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 table_.Register(kVisitNativeContext, &VisitNativeContext); | 151 table_.Register(kVisitNativeContext, &VisitNativeContext); |
152 | 152 |
153 table_.Register( | 153 table_.Register( |
154 kVisitAllocationSite, | 154 kVisitAllocationSite, |
155 &FixedBodyVisitor<StaticVisitor, AllocationSite::MarkingBodyDescriptor, | 155 &FixedBodyVisitor<StaticVisitor, AllocationSite::MarkingBodyDescriptor, |
156 void>::Visit); | 156 void>::Visit); |
157 | 157 |
158 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); | 158 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); |
159 | 159 |
160 table_.Register( | 160 table_.Register(kVisitBytecodeArray, &VisitBytecodeArray); |
161 kVisitBytecodeArray, | |
162 &FixedBodyVisitor<StaticVisitor, BytecodeArray::MarkingBodyDescriptor, | |
163 void>::Visit); | |
164 | 161 |
165 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); | 162 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); |
166 | 163 |
167 table_.Register(kVisitSeqOneByteString, &DataObjectVisitor::Visit); | 164 table_.Register(kVisitSeqOneByteString, &DataObjectVisitor::Visit); |
168 | 165 |
169 table_.Register(kVisitSeqTwoByteString, &DataObjectVisitor::Visit); | 166 table_.Register(kVisitSeqTwoByteString, &DataObjectVisitor::Visit); |
170 | 167 |
171 table_.Register(kVisitJSWeakCollection, &VisitWeakCollection); | 168 table_.Register(kVisitJSWeakCollection, &VisitWeakCollection); |
172 | 169 |
173 table_.Register( | 170 table_.Register( |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 target->ic_age() != heap->global_ic_age())) { | 276 target->ic_age() != heap->global_ic_age())) { |
280 ICUtility::Clear(heap->isolate(), rinfo->pc(), | 277 ICUtility::Clear(heap->isolate(), rinfo->pc(), |
281 rinfo->host()->constant_pool()); | 278 rinfo->host()->constant_pool()); |
282 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 279 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
283 } | 280 } |
284 Code* host = rinfo->host(); | 281 Code* host = rinfo->host(); |
285 heap->mark_compact_collector()->RecordRelocSlot(host, rinfo, target); | 282 heap->mark_compact_collector()->RecordRelocSlot(host, rinfo, target); |
286 StaticVisitor::MarkObject(heap, target); | 283 StaticVisitor::MarkObject(heap, target); |
287 } | 284 } |
288 | 285 |
289 | |
290 template <typename StaticVisitor> | 286 template <typename StaticVisitor> |
291 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( | 287 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( |
292 Heap* heap, RelocInfo* rinfo) { | 288 Heap* heap, RelocInfo* rinfo) { |
293 DCHECK(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); | 289 DCHECK(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); |
294 Code* target = rinfo->code_age_stub(); | 290 Code* target = rinfo->code_age_stub(); |
295 DCHECK(target != NULL); | 291 DCHECK(target != NULL); |
296 Code* host = rinfo->host(); | 292 Code* host = rinfo->host(); |
297 heap->mark_compact_collector()->RecordRelocSlot(host, rinfo, target); | 293 heap->mark_compact_collector()->RecordRelocSlot(host, rinfo, target); |
298 StaticVisitor::MarkObject(heap, target); | 294 StaticVisitor::MarkObject(heap, target); |
299 } | 295 } |
300 | 296 |
| 297 template <typename StaticVisitor> |
| 298 void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray( |
| 299 Map* map, HeapObject* object) { |
| 300 FixedBodyVisitor<StaticVisitor, BytecodeArray::MarkingBodyDescriptor, |
| 301 void>::Visit(map, object); |
| 302 BytecodeArray::cast(object)->MakeOlder(); |
| 303 } |
301 | 304 |
302 template <typename StaticVisitor> | 305 template <typename StaticVisitor> |
303 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( | 306 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( |
304 Map* map, HeapObject* object) { | 307 Map* map, HeapObject* object) { |
305 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor, | 308 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor, |
306 void>::Visit(map, object); | 309 void>::Visit(map, object); |
307 } | 310 } |
308 | 311 |
309 | 312 |
310 template <typename StaticVisitor> | 313 template <typename StaticVisitor> |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 660 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
658 void> JSFunctionWeakCodeBodyVisitor; | 661 void> JSFunctionWeakCodeBodyVisitor; |
659 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 662 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
660 } | 663 } |
661 | 664 |
662 | 665 |
663 } // namespace internal | 666 } // namespace internal |
664 } // namespace v8 | 667 } // namespace v8 |
665 | 668 |
666 #endif // V8_OBJECTS_VISITING_INL_H_ | 669 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |