Index: src/snapshot/startup-serializer.cc |
diff --git a/src/snapshot/startup-serializer.cc b/src/snapshot/startup-serializer.cc |
index 4d87c59115c439ebb6642c8e3832f0c505fdd87a..fab01f51f801d4db83f3f48d5d5405cfc86f6f3d 100644 |
--- a/src/snapshot/startup-serializer.cc |
+++ b/src/snapshot/startup-serializer.cc |
@@ -113,7 +113,12 @@ void StartupSerializer::SerializeStrongReferences() { |
CHECK(HasNotExceededFirstPageOfEachSpace()); |
serializing_immortal_immovables_roots_ = false; |
// Visit the rest of the strong roots. |
+ // Clear the stack limits to make the snapshot reproducible. |
+ // Reset it again afterwards. |
+ isolate->heap()->ClearStackLimits(); |
isolate->heap()->IterateSmiRoots(this); |
+ isolate->heap()->SetStackLimits(); |
+ |
isolate->heap()->IterateStrongRoots(this, |
VISIT_ONLY_STRONG_FOR_SERIALIZATION); |
} |