| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); | 594 HeapObject::RawField(map, Map::kPointerFieldsEndOffset)); |
| 595 } | 595 } |
| 596 | 596 |
| 597 | 597 |
| 598 template <typename StaticVisitor> | 598 template <typename StaticVisitor> |
| 599 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( | 599 void StaticMarkingVisitor<StaticVisitor>::MarkTransitionArray( |
| 600 Heap* heap, TransitionArray* transitions) { | 600 Heap* heap, TransitionArray* transitions) { |
| 601 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; | 601 if (!StaticVisitor::MarkObjectWithoutPush(heap, transitions)) return; |
| 602 | 602 |
| 603 if (transitions->HasPrototypeTransitions()) { | 603 if (transitions->HasPrototypeTransitions()) { |
| 604 // Mark prototype transitions array but do not push it onto marking | 604 StaticVisitor::VisitPointer(heap, |
| 605 // stack, this will make references from it weak. We will clean dead | 605 transitions->GetPrototypeTransitionsSlot()); |
| 606 // prototype transitions in ClearNonLiveReferences. | |
| 607 Object** slot = transitions->GetPrototypeTransitionsSlot(); | |
| 608 HeapObject* obj = HeapObject::cast(*slot); | |
| 609 heap->mark_compact_collector()->RecordSlot(slot, slot, obj); | |
| 610 StaticVisitor::MarkObjectWithoutPush(heap, obj); | |
| 611 } | 606 } |
| 612 | 607 |
| 613 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 608 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
| 614 for (int i = 0; i < num_transitions; ++i) { | 609 for (int i = 0; i < num_transitions; ++i) { |
| 615 StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i)); | 610 StaticVisitor::VisitPointer(heap, transitions->GetKeySlot(i)); |
| 616 } | 611 } |
| 617 } | 612 } |
| 618 | 613 |
| 619 | 614 |
| 620 template <typename StaticVisitor> | 615 template <typename StaticVisitor> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 | 864 |
| 870 RelocIterator it(this, mode_mask); | 865 RelocIterator it(this, mode_mask); |
| 871 for (; !it.done(); it.next()) { | 866 for (; !it.done(); it.next()) { |
| 872 it.rinfo()->template Visit<StaticVisitor>(heap); | 867 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 873 } | 868 } |
| 874 } | 869 } |
| 875 } | 870 } |
| 876 } // namespace v8::internal | 871 } // namespace v8::internal |
| 877 | 872 |
| 878 #endif // V8_OBJECTS_VISITING_INL_H_ | 873 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |