Index: src/snapshot/partial-serializer.cc |
diff --git a/src/snapshot/partial-serializer.cc b/src/snapshot/partial-serializer.cc |
index d1d33538ba5e28a50f20fad92485b27cfa50137a..b46f6755f0badab8e01e85b8b2eba317aeec724e 100644 |
--- a/src/snapshot/partial-serializer.cc |
+++ b/src/snapshot/partial-serializer.cc |
@@ -51,12 +51,16 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
// Replace typed arrays by undefined. |
if (obj->IsJSTypedArray()) obj = isolate_->heap()->undefined_value(); |
+ if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return; |
+ |
int root_index = root_index_map_.Lookup(obj); |
if (root_index != RootIndexMap::kInvalidRootIndex) { |
PutRoot(root_index, obj, how_to_code, where_to_point, skip); |
return; |
} |
+ if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return; |
+ |
if (ShouldBeInThePartialSnapshotCache(obj)) { |
FlushSkip(skip); |
@@ -77,16 +81,16 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
// Function and object templates are not context specific. |
DCHECK(!obj->IsTemplateInfo()); |
- if (SerializeKnownObject(obj, how_to_code, where_to_point, skip)) return; |
- |
FlushSkip(skip); |
// Clear literal boilerplates. |
if (obj->IsJSFunction()) { |
- LiteralsArray* literals = JSFunction::cast(obj)->literals(); |
+ JSFunction* function = JSFunction::cast(obj); |
+ LiteralsArray* literals = function->literals(); |
for (int i = 0; i < literals->literals_count(); i++) { |
literals->set_literal_undefined(i); |
} |
+ function->ClearTypeFeedbackInfo(); |
} |
// Object has not yet been serialized. Serialize it here. |