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/mark-compact.h" | 9 #include "src/heap/mark-compact.h" |
10 #include "src/heap/objects-visiting.h" | 10 #include "src/heap/objects-visiting.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray( | 288 void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray( |
289 Map* map, HeapObject* object) { | 289 Map* map, HeapObject* object) { |
290 FixedBodyVisitor<StaticVisitor, BytecodeArray::MarkingBodyDescriptor, | 290 FixedBodyVisitor<StaticVisitor, BytecodeArray::MarkingBodyDescriptor, |
291 void>::Visit(map, object); | 291 void>::Visit(map, object); |
292 BytecodeArray::cast(object)->MakeOlder(); | 292 BytecodeArray::cast(object)->MakeOlder(); |
293 } | 293 } |
294 | 294 |
295 template <typename StaticVisitor> | 295 template <typename StaticVisitor> |
296 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( | 296 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( |
297 Map* map, HeapObject* object) { | 297 Map* map, HeapObject* object) { |
298 // GC can happen when the context is not fully initialized, | |
299 // so the cache can be undefined. | |
300 Object* cache = | |
301 Context::cast(object)->get(Context::NORMALIZED_MAP_CACHE_INDEX); | |
302 if (cache->IsNormalizedMapCache()) { | |
303 NormalizedMapCache::cast(cache)->Clear(); | |
304 } | |
305 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor, | 298 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor, |
306 void>::Visit(map, object); | 299 void>::Visit(map, object); |
307 } | 300 } |
308 | 301 |
309 | 302 |
310 template <typename StaticVisitor> | 303 template <typename StaticVisitor> |
311 void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map, | 304 void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map, |
312 HeapObject* object) { | 305 HeapObject* object) { |
313 Heap* heap = map->GetHeap(); | 306 Heap* heap = map->GetHeap(); |
314 Map* map_object = Map::cast(object); | 307 Map* map_object = Map::cast(object); |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 639 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
647 void> JSFunctionWeakCodeBodyVisitor; | 640 void> JSFunctionWeakCodeBodyVisitor; |
648 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 641 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
649 } | 642 } |
650 | 643 |
651 | 644 |
652 } // namespace internal | 645 } // namespace internal |
653 } // namespace v8 | 646 } // namespace v8 |
654 | 647 |
655 #endif // V8_OBJECTS_VISITING_INL_H_ | 648 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |