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

Unified Diff: src/heap/scavenger.cc

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase 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 | « src/heap/scavenger.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/scavenger.cc
diff --git a/src/heap/scavenger.cc b/src/heap/scavenger.cc
index 7a8e55fd19320beb3dd0efbfc55bd794a1029bbf..72f8c1b786fbd1e4fc134e410a366c58525bd7f1 100644
--- a/src/heap/scavenger.cc
+++ b/src/heap/scavenger.cc
@@ -460,17 +460,24 @@ void Scavenger::SelectScavengingVisitorsTable() {
Isolate* Scavenger::isolate() { return heap()->isolate(); }
+void RootScavengeVisitor::VisitPointer(Object** p) { ScavengePointer(p); }
-void ScavengeVisitor::VisitPointer(Object** p) { ScavengePointer(p); }
+void RootScavengeVisitor::VisitPointers(Object** start, Object** end) {
+ // Copy all HeapObject pointers in [start, end)
+ for (Object** p = start; p < end; p++) ScavengePointer(p);
+}
+void RootScavengeVisitor::VisitRootPointer(Root root, Object** p) {
+ ScavengePointer(p);
+}
-void ScavengeVisitor::VisitPointers(Object** start, Object** end) {
+void RootScavengeVisitor::VisitRootPointers(Root root, Object** start,
+ Object** end) {
// Copy all HeapObject pointers in [start, end)
for (Object** p = start; p < end; p++) ScavengePointer(p);
}
-
-void ScavengeVisitor::ScavengePointer(Object** p) {
+void RootScavengeVisitor::ScavengePointer(Object** p) {
Object* object = *p;
if (!heap_->InNewSpace(object)) return;
« no previous file with comments | « src/heap/scavenger.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698