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); |