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/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 Loading... |
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 Loading... |
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_ |
OLD | NEW |