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

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

Issue 1169743002: Reland "Replace ad-hoc weakness in prototype transitions with WeakCell." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing slots recording Created 5 years, 6 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
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/transitions.h » ('j') | 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/objects-visiting.h" 8 #include "src/heap/objects-visiting.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); 564 HeapObject::RawField(map, Map::kPointerFieldsEndOffset));
565 } 565 }
566 566
567 567
568 template <typename StaticVisitor> 568 template <typename StaticVisitor>
569 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( 569 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray(
570 Heap* heap, TransitionArray* transitions) { 570 Heap* heap, TransitionArray* transitions) {
571 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; 571 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return;
572 572
573 if (transitions->HasPrototypeTransitions()) { 573 if (transitions->HasPrototypeTransitions()) {
574 // Mark prototype transitions array but do not push it onto marking 574 StaticVisitor::VisitPointer(heap,
575 // stack, this will make references from it weak. We will clean dead 575 transitions->GetPrototypeTransitionsSlot());
576 // prototype transitions in ClearNonLiveReferences.
577 Object** slot = transitions->GetPrototypeTransitionsSlot();
578 HeapObject* obj = HeapObject::cast(*slot);
579 heap->mark_compact_collector()->RecordSlot(slot, slot, obj);
580 StaticVisitor::MarkObjectWithoutPush(heap, obj);
581 } 576 }
582 577
583 int num_transitions = TransitionArray::NumberOfTransitions(transitions); 578 int num_transitions = TransitionArray::NumberOfTransitions(transitions);
584 for (int i = 0; i < num_transitions; ++i) { 579 for (int i = 0; i < num_transitions; ++i) {
585 StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i)); 580 StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i));
586 } 581 }
587 } 582 }
588 583
589 584
590 template <typename StaticVisitor> 585 template <typename StaticVisitor>
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 831
837 RelocIterator it(this, mode_mask); 832 RelocIterator it(this, mode_mask);
838 for (; !it.done(); it.next()) { 833 for (; !it.done(); it.next()) {
839 it.rinfo()->template Visit<StaticVisitor>(heap); 834 it.rinfo()->template Visit<StaticVisitor>(heap);
840 } 835 }
841 } 836 }
842 } 837 }
843 } // namespace v8::internal 838 } // namespace v8::internal
844 839
845 #endif // V8_OBJECTS_VISITING_INL_H_ 840 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698