Commit 1c542144 authored by ulan's avatar ulan Committed by Commit bot

[heap] Remove unused field of IterateAndScavengePromotedObjectsVisitor.

BUG=v8:6325

Review-Url: https://codereview.chromium.org/2849763004
Cr-Commit-Position: refs/heads/master@{#44977}
parent af85b62f
...@@ -4811,13 +4811,11 @@ void Heap::ZapFromSpace() { ...@@ -4811,13 +4811,11 @@ void Heap::ZapFromSpace() {
class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor { class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
public: public:
IterateAndScavengePromotedObjectsVisitor(Heap* heap, HeapObject* target, IterateAndScavengePromotedObjectsVisitor(Heap* heap, bool record_slots)
bool record_slots) : heap_(heap), record_slots_(record_slots) {}
: heap_(heap), target_(target), record_slots_(record_slots) {}
inline void VisitPointers(HeapObject* host, Object** start, inline void VisitPointers(HeapObject* host, Object** start,
Object** end) override { Object** end) override {
DCHECK_EQ(host, target_);
Address slot_address = reinterpret_cast<Address>(start); Address slot_address = reinterpret_cast<Address>(start);
Page* page = Page::FromAddress(slot_address); Page* page = Page::FromAddress(slot_address);
...@@ -4840,7 +4838,7 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor { ...@@ -4840,7 +4838,7 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
} else if (record_slots_ && } else if (record_slots_ &&
MarkCompactCollector::IsOnEvacuationCandidate( MarkCompactCollector::IsOnEvacuationCandidate(
HeapObject::cast(target))) { HeapObject::cast(target))) {
heap_->mark_compact_collector()->RecordSlot(target_, slot, target); heap_->mark_compact_collector()->RecordSlot(host, slot, target);
} }
} }
...@@ -4860,7 +4858,6 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor { ...@@ -4860,7 +4858,6 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
private: private:
Heap* heap_; Heap* heap_;
HeapObject* target_;
bool record_slots_; bool record_slots_;
}; };
...@@ -4878,9 +4875,7 @@ void Heap::IterateAndScavengePromotedObject(HeapObject* target, int size, ...@@ -4878,9 +4875,7 @@ void Heap::IterateAndScavengePromotedObject(HeapObject* target, int size,
ObjectMarking::IsBlack(target, MarkingState::Internal(target)); ObjectMarking::IsBlack(target, MarkingState::Internal(target));
} }
// TODO(ulan): remove the target, the visitor now gets the host object IterateAndScavengePromotedObjectsVisitor visitor(this, record_slots);
// in each visit method.
IterateAndScavengePromotedObjectsVisitor visitor(this, target, record_slots);
if (target->IsJSFunction()) { if (target->IsJSFunction()) {
// JSFunctions reachable through kNextFunctionLinkOffset are weak. Slots for // JSFunctions reachable through kNextFunctionLinkOffset are weak. Slots for
// this links are recorded during processing of weak lists. // this links are recorded during processing of weak lists.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment