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 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 4678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4689 heap_->IteratePromotedObjectPointers( | 4689 heap_->IteratePromotedObjectPointers( |
4690 target_, reinterpret_cast<Address>(start), | 4690 target_, reinterpret_cast<Address>(start), |
4691 reinterpret_cast<Address>(end), record_slots_, callback_); | 4691 reinterpret_cast<Address>(end), record_slots_, callback_); |
4692 } | 4692 } |
4693 | 4693 |
4694 V8_INLINE void VisitCodeEntry(Address code_entry_slot) override { | 4694 V8_INLINE void VisitCodeEntry(Address code_entry_slot) override { |
4695 // Black allocation requires us to process objects referenced by | 4695 // Black allocation requires us to process objects referenced by |
4696 // promoted objects. | 4696 // promoted objects. |
4697 if (heap_->incremental_marking()->black_allocation()) { | 4697 if (heap_->incremental_marking()->black_allocation()) { |
4698 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); | 4698 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot)); |
4699 IncrementalMarking::MarkObject(heap_, code); | 4699 IncrementalMarking::MarkGrey(heap_, code); |
4700 } | 4700 } |
4701 } | 4701 } |
4702 | 4702 |
4703 private: | 4703 private: |
4704 Heap* heap_; | 4704 Heap* heap_; |
4705 HeapObject* target_; | 4705 HeapObject* target_; |
4706 bool record_slots_; | 4706 bool record_slots_; |
4707 ObjectSlotCallback callback_; | 4707 ObjectSlotCallback callback_; |
4708 }; | 4708 }; |
4709 | 4709 |
(...skipping 15 matching lines...) Expand all Loading... |
4725 IteratePromotedObjectsVisitor visitor(this, target, record_slots, callback); | 4725 IteratePromotedObjectsVisitor visitor(this, target, record_slots, callback); |
4726 target->IterateBody(target->map()->instance_type(), size, &visitor); | 4726 target->IterateBody(target->map()->instance_type(), size, &visitor); |
4727 | 4727 |
4728 // When black allocations is on, we have to visit not already marked black | 4728 // When black allocations is on, we have to visit not already marked black |
4729 // objects (in new space) promoted to black pages to keep their references | 4729 // objects (in new space) promoted to black pages to keep their references |
4730 // alive. | 4730 // alive. |
4731 // TODO(hpayer): Implement a special promotion visitor that incorporates | 4731 // TODO(hpayer): Implement a special promotion visitor that incorporates |
4732 // regular visiting and IteratePromotedObjectPointers. | 4732 // regular visiting and IteratePromotedObjectPointers. |
4733 if (!was_marked_black) { | 4733 if (!was_marked_black) { |
4734 if (incremental_marking()->black_allocation()) { | 4734 if (incremental_marking()->black_allocation()) { |
4735 IncrementalMarking::MarkObject(this, target->map()); | 4735 IncrementalMarking::MarkGrey(this, target->map()); |
4736 incremental_marking()->IterateBlackObject(target); | 4736 incremental_marking()->IterateBlackObject(target); |
4737 } | 4737 } |
4738 } | 4738 } |
4739 } | 4739 } |
4740 | 4740 |
4741 | 4741 |
4742 void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) { | 4742 void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) { |
4743 IterateStrongRoots(v, mode); | 4743 IterateStrongRoots(v, mode); |
4744 IterateWeakRoots(v, mode); | 4744 IterateWeakRoots(v, mode); |
4745 } | 4745 } |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6452 } | 6452 } |
6453 | 6453 |
6454 | 6454 |
6455 // static | 6455 // static |
6456 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6456 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6457 return StaticVisitorBase::GetVisitorId(map); | 6457 return StaticVisitorBase::GetVisitorId(map); |
6458 } | 6458 } |
6459 | 6459 |
6460 } // namespace internal | 6460 } // namespace internal |
6461 } // namespace v8 | 6461 } // namespace v8 |
OLD | NEW |