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

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

Issue 1463483002: [heap] Move slot recording of weak fields in native context to native context list retainer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/heap/objects-visiting.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/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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); 297 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target);
298 StaticVisitor::MarkObject(heap, target); 298 StaticVisitor::MarkObject(heap, target);
299 } 299 }
300 300
301 301
302 template <typename StaticVisitor> 302 template <typename StaticVisitor>
303 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( 303 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext(
304 Map* map, HeapObject* object) { 304 Map* map, HeapObject* object) {
305 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor, 305 FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor,
306 void>::Visit(map, object); 306 void>::Visit(map, object);
307
308 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector();
309 for (int idx = Context::FIRST_WEAK_SLOT; idx < Context::NATIVE_CONTEXT_SLOTS;
310 ++idx) {
311 Object** slot = Context::cast(object)->RawFieldOfElementAt(idx);
312 collector->RecordSlot(object, slot, *slot);
313 }
314 } 307 }
315 308
316 309
317 template <typename StaticVisitor> 310 template <typename StaticVisitor>
318 void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map, 311 void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map,
319 HeapObject* object) { 312 HeapObject* object) {
320 Heap* heap = map->GetHeap(); 313 Heap* heap = map->GetHeap();
321 Map* map_object = Map::cast(object); 314 Map* map_object = Map::cast(object);
322 315
323 // Clears the cache of ICs related to this map. 316 // Clears the cache of ICs related to this map.
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, 814 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode,
822 void> JSFunctionWeakCodeBodyVisitor; 815 void> JSFunctionWeakCodeBodyVisitor;
823 JSFunctionWeakCodeBodyVisitor::Visit(map, object); 816 JSFunctionWeakCodeBodyVisitor::Visit(map, object);
824 } 817 }
825 818
826 819
827 } // namespace internal 820 } // namespace internal
828 } // namespace v8 821 } // namespace v8
829 822
830 #endif // V8_OBJECTS_VISITING_INL_H_ 823 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698