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