Commit e8969055 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[snapshot] Clean up Strong root iteration in deserialization

When deserializing the startup snapshot, call IterateStrongRoots with
VISIT_FOR_SERIALIZATION rather than VISIT_ONLY_STRONG. To compensate,
make the StartupDeserializer explicitly iterate over the partial
snapshot cache.

This makes the deserializer and serializer consistent in their use of
the function and makes their differences explicit in the snapshot code
itself.

Bug: chromium:902230
Change-Id: I3a2ac858f4f6b3097b98a10ed2dd5ac5b9bf83e8
Reviewed-on: https://chromium-review.googlesource.com/c/1319585
Commit-Queue: Dan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57275}
parent 8fd5fa22
......@@ -3860,11 +3860,11 @@ void Heap::IterateStrongRoots(RootVisitor* v, VisitMode mode) {
}
v->Synchronize(VisitorSynchronization::kStrongRoots);
// Iterate over the partial snapshot cache unless serializing.
// Iterate over the partial snapshot cache unless serializing or
// deserializing.
if (mode != VISIT_FOR_SERIALIZATION) {
SerializerDeserializer::Iterate(isolate_, v);
// We don't do a v->Synchronize call here because the serializer and the
// deserializer are deliberately out of sync here.
v->Synchronize(VisitorSynchronization::kPartialSnapshotCache);
}
}
......
......@@ -38,7 +38,8 @@ void StartupDeserializer::DeserializeInto(Isolate* isolate) {
{
DisallowHeapAllocation no_gc;
isolate->heap()->IterateSmiRoots(this);
isolate->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG);
isolate->heap()->IterateStrongRoots(this, VISIT_FOR_SERIALIZATION);
Iterate(isolate, this);
isolate->heap()->IterateWeakRoots(this, VISIT_FOR_SERIALIZATION);
DeserializeDeferredObjects();
RestoreExternalReferenceRedirectors(accessor_infos());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment