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

Unified Diff: src/snapshot/startup-serializer.cc

Issue 2055203002: [snapshot] support multiple contexts in the same snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@sinkmember
Patch Set: fix test. again. Created 4 years, 6 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') | test/cctest/test-serialize.cc » ('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 c882ceb95434d23bd528c8f66a8931334a18b474..573e73d174ddb6e09ef780b1d8e98d3faf2e9952 100644
--- a/src/snapshot/startup-serializer.cc
+++ b/src/snapshot/startup-serializer.cc
@@ -90,6 +90,17 @@ void StartupSerializer::SerializeWeakReferencesAndDeferred() {
Pad();
}
+int StartupSerializer::PartialSnapshotCacheIndex(HeapObject* heap_object) {
+ int index;
+ if (!partial_cache_index_map_.LookupOrInsert(heap_object, &index)) {
+ // 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));
+ }
+ return index;
+}
+
void StartupSerializer::Synchronize(VisitorSynchronization::SyncTag tag) {
// We expect the builtins tag after builtins have been serialized.
DCHECK(!serializing_builtins_ || tag == VisitorSynchronization::kBuiltins);
« no previous file with comments | « src/snapshot/startup-serializer.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698