Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: src/heap/heap.cc

Issue 2849763004: [heap] Remove unused field of IterateAndScavengePromotedObjectsVisitor. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 8706113ae981bd25cd3302a94792143d30f4eed2..4b71c4f0d9dee08a4389258a0e7efb238e266700 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4812,13 +4812,11 @@ void Heap::ZapFromSpace() {
class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
public:
- IterateAndScavengePromotedObjectsVisitor(Heap* heap, HeapObject* target,
- bool record_slots)
- : heap_(heap), target_(target), record_slots_(record_slots) {}
+ IterateAndScavengePromotedObjectsVisitor(Heap* heap, bool record_slots)
+ : heap_(heap), record_slots_(record_slots) {}
inline void VisitPointers(HeapObject* host, Object** start,
Object** end) override {
- DCHECK_EQ(host, target_);
Address slot_address = reinterpret_cast<Address>(start);
Page* page = Page::FromAddress(slot_address);
@@ -4841,7 +4839,7 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
} else if (record_slots_ &&
MarkCompactCollector::IsOnEvacuationCandidate(
HeapObject::cast(target))) {
- heap_->mark_compact_collector()->RecordSlot(target_, slot, target);
+ heap_->mark_compact_collector()->RecordSlot(host, slot, target);
}
}
@@ -4861,7 +4859,6 @@ class IterateAndScavengePromotedObjectsVisitor final : public ObjectVisitor {
private:
Heap* heap_;
- HeapObject* target_;
bool record_slots_;
};
@@ -4879,9 +4876,7 @@ void Heap::IterateAndScavengePromotedObject(HeapObject* target, int size,
ObjectMarking::IsBlack(target, MarkingState::Internal(target));
}
- // TODO(ulan): remove the target, the visitor now gets the host object
- // in each visit method.
- IterateAndScavengePromotedObjectsVisitor visitor(this, target, record_slots);
+ IterateAndScavengePromotedObjectsVisitor visitor(this, record_slots);
if (target->IsJSFunction()) {
// JSFunctions reachable through kNextFunctionLinkOffset are weak. Slots for
// this links are recorded during processing of weak lists.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698