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

Unified Diff: src/snapshot/startup-serializer.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/snapshot/startup-serializer.h ('k') | src/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/startup-serializer.cc
diff --git a/src/snapshot/startup-serializer.cc b/src/snapshot/startup-serializer.cc
index 4b27746f8eefa0cce128468249d2d25f526be12b..377793c859b3fd581fb29673eecfda7a0df24cb5 100644
--- a/src/snapshot/startup-serializer.cc
+++ b/src/snapshot/startup-serializer.cc
@@ -95,7 +95,7 @@ void StartupSerializer::SerializeWeakReferencesAndDeferred() {
// add entries to the partial snapshot cache of the startup snapshot. Add
// one entry with 'undefined' to terminate the partial snapshot cache.
Object* undefined = isolate()->heap()->undefined_value();
- VisitPointer(&undefined);
+ VisitRootPointer(Root::kPartialSnapshotCache, &undefined);
isolate()->heap()->IterateWeakRoots(this, VISIT_ALL);
SerializeDeferredObjects();
Pad();
@@ -107,7 +107,8 @@ int StartupSerializer::PartialSnapshotCacheIndex(HeapObject* heap_object) {
// This object is not part of the partial snapshot cache yet. Add it to the
// startup snapshot so we can refer to it via partial snapshot index from
// the partial snapshot.
- VisitPointer(reinterpret_cast<Object**>(&heap_object));
+ VisitRootPointer(Root::kPartialSnapshotCache,
+ reinterpret_cast<Object**>(&heap_object));
}
return index;
}
@@ -144,7 +145,8 @@ void StartupSerializer::SerializeStrongReferences() {
VISIT_ONLY_STRONG_FOR_SERIALIZATION);
}
-void StartupSerializer::VisitPointers(Object** start, Object** end) {
+void StartupSerializer::VisitRootPointers(Root root, Object** start,
+ Object** end) {
if (start == isolate()->heap()->roots_array_start()) {
// Serializing the root list needs special handling:
// - The first pass over the root list only serializes immortal immovables.
@@ -171,7 +173,7 @@ void StartupSerializer::VisitPointers(Object** start, Object** end) {
}
FlushSkip(skip);
} else {
- Serializer::VisitPointers(start, end);
+ Serializer::VisitRootPointers(root, start, end);
}
}
« no previous file with comments | « src/snapshot/startup-serializer.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698