Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: src/heap/objects-visiting-inl.h

Issue 2745183002: [heap] Simplify clearing of normalized map caches. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/heap/heap.cc ('K') | « src/heap/incremental-marking.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
298 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor, 305 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor,
299 void>::Visit(map, object); 306 void>::Visit(map, object);
300 } 307 }
301 308
302 309
303 template <typename StaticVisitor> 310 template <typename StaticVisitor>
304 void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map, 311 void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map,
305 HeapObject* object) { 312 HeapObject* object) {
306 Heap* heap = map->GetHeap(); 313 Heap* heap = map->GetHeap();
307 Map* map_object = Map::cast(object); 314 Map* map_object = Map::cast(object);
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, 646 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode,
640 void> JSFunctionWeakCodeBodyVisitor; 647 void> JSFunctionWeakCodeBodyVisitor;
641 JSFunctionWeakCodeBodyVisitor::Visit(map, object); 648 JSFunctionWeakCodeBodyVisitor::Visit(map, object);
642 } 649 }
643 650
644 651
645 } // namespace internal 652 } // namespace internal
646 } // namespace v8 653 } // namespace v8
647 654
648 #endif // V8_OBJECTS_VISITING_INL_H_ 655 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« src/heap/heap.cc ('K') | « src/heap/incremental-marking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698