Index: src/snapshot/serialize.cc |
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc |
index 2179c8de6b881c2c8bf87f71fa6d7350aac6cae9..2e9ce13c75c70a9928ed326c87ffbf09052905b0 100644 |
--- a/src/snapshot/serialize.cc |
+++ b/src/snapshot/serialize.cc |
@@ -1577,6 +1577,12 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
FlushSkip(skip); |
+ // Clear literal boilerplates. |
+ if (obj->IsJSFunction() && !JSFunction::cast(obj)->shared()->bound()) { |
+ FixedArray* literals = JSFunction::cast(obj)->literals(); |
+ for (int i = 0; i < literals->length(); i++) literals->set_undefined(i); |
+ } |
+ |
// Object has not yet been serialized. Serialize it here. |
ObjectSerializer serializer(this, obj, sink_, how_to_code, where_to_point); |
serializer.Serialize(); |